KKnd   PmWikiZhCnUtf8 /
CustomHeadersAndFooters
SearchWiki
PmWikiZhCnUtf8.最近改变
编辑页面
页面修正

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 local.php file (described in InitialSetupTasks and LocalCustomizations).

A page has two headers variables:

Header text in the <head>...</head> tags

$HTMLStartFmt, $HTMLTitleFmt, $HTMLHeaderFmt, and $HTMLBodyFmt

The HTML header prior to the output body is controlled by the $HTMLStartFmt, $HTMLTitleFmt, $HTMLHeaderFmt, and $HTMLBodyFmt variables. $HTMLStartFmt contains the markup used to begin an HTML document. The default contains 3 lines including the document type declaration and ending with with the <head> tag. $HTMLTitleFmt contains the HTML title to be used for the document (normally displayed in the title bar of the browser window). $HTMLHeaderFmt provides additional HTML markup to be included in the <HEAD> section of the document such as stylesheet attributes or reference links. Finally, $HTMLBodyFmt contains the markup to end the <HEAD> section and begin the <BODY> of the HTML output up to either the editable section or the PageHeaderFmt.

For example, if you wanted to add a new cascading stylesheet definition to the <HEAD> section of the HTML output, you can do it by adding the following to local.php:

    $HTMLHeaderFmt .= "<style type='text/css'> .redtext { color:red; } </style>"; 

Header text at the beginning of the <body> tag

$PageHeaderFmt

The information to be displayed at the top of each browse page is controlled by the $PageHeaderFmt variable. This variable contains the HTML markup to be sent at the beginning of the <BODY> section of the output of a browse page. $PageHeaderFmt (and all PmWiki.Variables ending in "Fmt") are processed for global $-variable substitution before being printed, thus the string $Title inside of $PageHeaderFmt will be replaced by the page's actual title when it is output to the browser. This variable's default contains the markup for the Search/Edit/Recent Changes and Page Revisions links. If you choose not to use the default, your Group.php page would read $PageHeaderFmt = "" for no headers or your own markup can be used such as hiding the edit link unless a mouseover occurs.

For complete control of generation of page headers, the $PageHeaderFmt variable can contain the name of a PHP function which will be called to generate a page header. The function will be called with the pagename and page fields as arguments. In this case, PmWiki assumes that the user-supplied function will take care of all required header formatting, and none of the $HTMLxxx variables are used (unless the called function uses them directly).


Footers

Like the header, the footer is controlled by the $PageFooterFmt and $HTMLEndFmt variables, which are analogous to the variables described above. $HTMLEndFmt contains the HTML markup to be printed at the end of any page that used $HTMLStartFmt; $PageFooterFmt is a string (function name) to be printed (called) at the bottom of a browsed wiki page. As before, any $-variables are substituted when the string is being output.

<< ChangePmWikiURL | PmWikiZhCnUtf8.DocumentationIndex | PerGroupCustomizations? >>


编辑页面 - 页面修正 - WikiHelp - SearchWiki - 最近改变 - Printable Version
页面最后更新于 20 八月, 2003, 时间 11:37

©
copyleft by [email protected]
or
[email protected]