AllGroupHeader

Summary: How to create a page that appears as a header (or footer) for all pages in all groups
Version: 1
Status: Stable
Prerequisites: pmwiki-2.0
Maintainer:
Categories: Layout
Users: +2 (View / Edit)

Question

How do I create a Site.AllGroupHeader page which can contain styles and content for all pages in all groups?

Answer

If the group contains a wiki page called GroupHeader, that page will be included first in every group. PmWiki achieves this by use of the variable $GroupHeaderFmt. This variable can be redefined in local/config.php to have a page Site.AllGroupHeader at the top of all wiki pages in all groups through the following:

$GroupHeaderFmt =
  '(:include {$SiteGroup}.AllGroupHeader:)(:nl:)'
  .'(:include {$Group}.GroupHeader:)(:nl:)';

The variable $SiteGroup usually refers to Site/, so unless you change it, the page that defines the site wide header will be Site.AllGroupHeader. See Cookbook.MainGroupChange for more details about changing the default group.

Alternatively you can have a site-wide header as a default that can be overridden by a $Group.GroupHeader page. You can set:

$GroupHeaderFmt =
  '(:include {$Group}.GroupHeader {$SiteGroup}.SiteHeader:)(:nl:)';

which uses the group's GroupHeader if it exists, otherwise it uses Site.SiteHeader.

See Also

Contributors

-- Pm, Christian, Hans

User notes +2: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.