IncludeWikiContent Examples

About this HowTo

MoinMoin versions
1.8.1, 1.7.x
Platforms
Linux and other POSIX, Windows, Mac OS X...

Some examples on how to use the IncludeWikiContent macro.

Admin Bar

Suppose, you have your ProjectTemplate generated pages (projects) and some ACL group pages generated below. You want to manage your groups the fastest way possible - you create your template like this:

#acl +MacroMarket/IncludeWikiContent/Examples/AdminGroup:admin,delete,revert +MacroMarket/IncludeWikiContent/Examples/ReadWriteGroup:read,write +MacroMarket/IncludeWikiContent/Examples/ReadGroup:read All:
#format wiki
#language en

= *** Project Name *** =

Describe your project here...


||<) tablestyle="width:100%; border: 0px; background-color: #cccccc; margin: 40px 0px 0px 0px;" style="border: 0px;">  ||<: style="border: 0px;"> [[/AdminGroup|{{attachment:Common/admingroup.png}}]][[/ReadWriteGroup|{{attachment:Common/readwritegroup.png}}]][[/ReadGroup|{{attachment:Common/readonlygroup.png}}]]  ||<( style="border: 0px;">  ||

----

Add this page to a category ...

The page gets rendered into:

projecttemplate1.png

Now, if you create your projects like this, each time you want to change your admin bar, you will need to edit each project separately!

If you put your admin bar into a subpage (ProjectTemplate/AdminBar), you will be able to share it between projects. But <<Include>> will not allow you to create relative links resolved to your primary page! IncludeWikiContent will!

Now, the ProjectTemplate/AdminBar looks like this:

||<) tablestyle="width:100%; border: 0px; background-color: #cccccc; margin: 40px 0px 0px 0px;" style="border: 0px;">  ||<: style="border: 0px;"> [[/AdminGroup|{{attachment:Common/admingroup.png}}]][[/ReadWriteGroup|{{attachment:Common/readwritegroup.png}}]][[/ReadGroup|{{attachment:Common/readonlygroup.png}}]]  ||<( style="border: 0px;">  ||

adminbar.png

And refined ProjectTemplate page (changes needed to use admin bar properly):

#acl +MacroMarket/IncludeWikiContent/Examples/AdminGroup:admin,delete,revert +MacroMarket/IncludeWikiContent/Examples/ReadWriteGroup:read,write +MacroMarket/IncludeWikiContent/Examples/ReadGroup:read All:
#format wiki
#language en

= *** Project Name *** =

Describe your project here...

<<IncludeWikiContent(ProjectTemplate/AdminBar)>>

----

Add this page to a category ...

All AdminBar relative links will be now resolved to your project page (unlike with the Include macro)

MoinMoin: MacroMarket/IncludeWikiContent/Examples (last edited 2009-03-17 12:49:41 by r9)