version=pmwiki-0.6.beta15 newline=² text=The CustomHeadersAndFooters page gives a brief introduction to modifying the display of pages in PmWiki. This page describes the entire layout sequence in greater detail.²²->%note% Note: This page still reflects the structure of the layout used in PmWiki version 0.5, and needs to be updated for PmWiki version 0.6. ²²First it's helpful to review the basic structure of an HTML document. A script creating an HTML document must basically produce the following parts:²² HTTP Headers Content-type:, etc.² document type ² header ² document title ...² stylesheets ² other header tags ² body ² HTML markup , text, , etc.² end of document ²²In general, each component of the document that PmWiki produces can be controlled by one or more configuration variables. For example, the variables controlling the display of a wiki page are given by²² HTTP Headers Content-type:, etc. $HTTPHeaders² document type $HTMLDoctypeFmt² header "² document title ... $HTMLTitleFmt² stylesheets $HTMLHeaderFmt² other header tags "² body $HTMLBodyFmt² header
, text, , etc. $PageHeaderFmt² wiki text " [=PrintText()=] function² footer " $PageFooterFmt² end of document $HTMLEndFmt²²As with $PageHeaderFmt and $PageFooterFmt (described in CustomHeadersAndFooters), the other 'Fmt' variables can contain references to files on disk, user-defined functions, and wiki pages. In fact, PmWiki defines the $HTMLStartFmt variable to aggregate the output up to the HTML tag:²² $HTMLStartFmt = array('headers:', &$HTMLDoctypeFmt, &$HTMLTitleFmt,² &$HTMLHeaderFmt, $HTMLBodyFmt);²²Finally, most of the major PmWiki operations (browse, edit, search, etc.) have variables that define the entire page contents. For example, the layout of a page being displayed via the default browse action is specified by²² $HandleBrowseFmt = array(&$HTMLStartFmt, &$PageHeaderFmt, &$PageTitleFmt,² [="function:PrintText"=], &$PageFooterFmt, &$HTMLEndFmt);²²which outputs all of the HTML header components, $PageHeaderFmt, the text of the wiki page itself, $PageFooterFmt, and the end of the html document.²²%trail%<<|PmWiki.DocumentationIndex|>>²² time=1076999465 host=24.1.44.14 agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) rev=9 author=Pm name=PmWiki.PageLayout