SearchWiki:
Login  |  Language:  En | Ru

Fidolook

Extensions

PmWiki



Recent Changes Printable View Page History Edit Page
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: 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 = '/filelocal/myheader.html';    
    # 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.

<< | PmWiki.DocumentationIndex | >>

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki Page last modified on February 17, 2004 01:07AM