9 lines
2.9 KiB
Text
9 lines
2.9 KiB
Text
version=pmwiki-0.6.beta15
|
|
newline=²
|
|
text=This page describes how you can change the default headers and footers that appear on PmWiki pages. Setting the headers and footers is usually done by changing the value of {{variables}} in the ''config.php'' file (described in InitialSetupTasks and LocalCustomizations).²²-> %note% Note: This page describes the customization options that were used for version 0.5. While the notes below are still correct for version 0.6, version 0.6 provides a more advanced layout mechanism based on stylesheets. See LayoutBasics for more details.²²The appearance of a page in PmWiki is controlled by the $PageHeaderFmt and $PageFooterFmt variables. $PageHeaderFmt specifies the HTML markup to be output after the HTML <body> tag but before the contents of the wiki page itself. $PageFooterFmt specifies the HTML markup after the contents of the wiki page but before the closing </body> tag. To change the page layout to contain only a simple title at the top and an "Edit Page" link at the bottom, one could do (in ''config.php''):²² $PageHeaderFmt = '<h1>$Title</h1><hr />';² $PageFooterFmt = '<hr /><small><a href="$PageUrl?action=edit">Edit² Page</a></small>';²²Both of these variables (and most PmWiki variables ending in 'Fmt') are processed for global $-variable substitutions prior to being output. Thus, @@$Title@@ and @@$PageUrl@@ in the above statements will be replaced with the title of the page and the URL of the page when the values are output.²²$PageHeaderFmt and $PageFooterFmt also allow the HTML output to come from a file on disk, an administrator-defined PHP function, or another wiki page. For example, one can create a file called ''local/myheader.html'' with the markup for the HTML page header, and then include the contents of that file as the header by specifying²² $PageHeaderFmt = [='file:local/myheader.html'=];²²Other examples include:² [=² # include a php file² $PageHeaderFmt = 'file:local/myheader.php'; ² # a user-defined function² $PageHeaderFmt = 'function:MyHeaderFunction'; ² # a per-group PageHeader wiki page ² $PageHeaderFmt = 'wiki:$Group.PageHeader'; =] ²²Finally, any of these variables can be arrays of values to be output, allowing combinations of the above. For example² [=² $PageHeaderFmt = array(² '<h1>$Group.$Title</h1><table><tr><td width="20%">',² 'wiki:$Group.LeftMenu',² '</td><td>');² $PageFooterFmt = '</td></table>';=]²²will display a page with the group name and title at the top, followed by a two-cell HTML table with the contents of the [=LeftMenu=] page in the left cell and the contents of the wiki page in the right cell.²²See PageLayout for more details about the organization and structure of pages produced by PmWiki.²²%trail%<<|PmWiki.DocumentationIndex|>>²
|
|
time=1076998070
|
|
host=24.1.44.14
|
|
agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
|
|
rev=23
|
|
author=Pm
|
|
name=PmWiki.CustomHeadersAndFooters
|