Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

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
Votes:

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.SideHeader.

Notes and Comments

Here are equivalent variables for footers:

$GroupFooterFmt =
  '(:nl:)(:include $SiteGroup.AllGroupFooter:)'
  .'(:nl:)(:include $Group.GroupFooter:)';

and

$GroupFooterFmt =
  '(:nl:)(:include {$Group}.GroupFooter {$SiteGroup}.SiteFooter:)';

See Also

Contributors

-- Pm, Christian, Hans

Question

Problem: When adding this script into the webpage the {$Group}-tag on the header-page has the value of the header-page-group instead of the text-group... (Hard to explain, but I hope you understand....)

How do I solve this? //Rufus

Use {*$Group} to refer to the group of the text page. -- Pm
Edit - History - Print - Recent Changes - Search
Page last modified on August 27, 2007, at 04:08 PM