Custom Page Header
What
- Author control over page header
- Users "fake" {{pagetitle}} action.
Use
- include {{pagetitle The page title here}} anywhere in the page.
Installation
- Create a "pagetitle.php" as an empty file in the actions folder.
- Put the following code into the wakka.class.php file.
- Modify the actions/header.php to use $this->PageHeader() to populate the page title HTML tags.
Added to wakka.class.php
// DW - Added (Process {{pagetitle name}} fake action)
function PageHeader() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "({){2}pagetitle ([^}\n]+)(}){2}", $pagecontent, $title)) {
$title = $title[2];
}
if ($title) return strip_tags($this->Format($title)); # fix for forced links in heading
else return $this->GetPageTag();
}
function PageHeader() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "({){2}pagetitle ([^}\n]+)(}){2}", $pagecontent, $title)) {
$title = $title[2];
}
if ($title) return strip_tags($this->Format($title)); # fix for forced links in heading
else return $this->GetPageTag();
}
header.php
$PgTitle = $this->PageHeader();
.
.
.
<title><?php echo $PgTitle; ?></title>
.
.
.
<title><?php echo $PgTitle; ?></title>
CategoryUserContributions