最近更新 - 使用說明 - 測試區 - 搜尋:
●獅吼文集
楔子?
佛法入門?
三藏經典?
修持正見?
法義討論?
實修儀軌?
名相淺釋?
佛教X檔案?
學佛心得?
佛教人物?
●其它
暫存區?
工作討論?
編輯選單

連結!pmwiki.org
* Cookbook
* Development
* PmWikiUsers
* SuccessStories

編輯本頁 列印預覽 群組歷史 本頁歷史


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 = '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.

<< | PmWiki.DocumentationIndex | >>

編輯本頁 - 列印預覽 - 群組歷史 - 本頁歷史 - 搜尋
本頁更新於 2004 年 02 月 17 日,02:07 PM