[Pmwiki-users] advanced wikistyles (testing/feedback wanted)

Patrick R. Michaud pmichaud
Wed Jul 21 22:30:26 CDT 2004


On Wed, Jul 21, 2004 at 11:08:00PM -0400, Kass Lloyd wrote:
> 
> Is there anyway to make these style definitions global for the whole
> group and/or wiki? [...]
> It would be kinda useful I think to setup some default styles for
> things that you don't have to define on every page, and have the ease
> to edit/add to them online.

Well, there's always GroupHeader.  And to keep from duplicating all of
the styles in every GroupHeader, you can just put [:include Main/SiteHeader:]
in each group's GroupHeader and the contents of Main.SiteHeader 
(presumably style definitions) would be automatically defined in the group.

But it gets better. :-)  

In PmWiki 2.0 GroupHeader and GroupFooter are implemented via wiki 
markup.  So, in config.php one can do

    $GroupHeaderFmt = 
      '[:include Main.SiteHeader:][:nl:][:include $Group.GroupHeader:][:nl:]';

and the contents of Main.SiteHeader will be automatically included 
on every page in every group, just before the GroupHeader.  (The [:nl:]
directive says to add a newline at this point if one isn't already there,
and handles missing newlines at the end of included text.)

I haven't defaulted to automatically including a global page because 
(1) I don't like the pagename Main.SiteHeader and (2) I like to 
keep groups a bit more separate.

Someday this could even extend to doing something like

    $GroupHeaderFmt = '[:include $AuthorGroup.$Author:][:nl:]
      [:include Main.SiteHeader:][:nl:]
      [:include $Group.GroupHeader:][:nl:]';  

which would allow author-specific directives (e.g., for user-preferences)
to be processed on every page.

Pm



More information about the pmwiki-users mailing list