[Pmwiki-users] Re: $HTMLTitle controlled by page author?
John Rankin
john.rankin
Tue Mar 2 22:04:51 CST 2004
Actually, you could do this as a local customisation.
Off the top of my head, something like the following
should work:
1. introduce markup like
=title Text you want to have put into $HTMLTitle
2. change the template so it reads something like
<!--function:SetHTMLTltle-->
$HTMLTitleFmt
The $HTMLTitleFmt is initialised in pmwiki.php, but
you could over-ride this.
3. create in local.php a
function SetHTMLTltle($pagename) {
global $Text,$HTMLTitleFmt;
if preg_match('/=title\s+(.*?)\n/',$Text,$match)
$HTMLTitleFmt = "<title>$match[1]</title>";
}
4. deal with =title in the rendered page:
$DoubleBrackets['/^=title\s+(.*?)$/'] = "''$1''";
would render it in italics, for example.
The down-side is that every page gets searched for =title
on display, so as Patrick says, it would be better to make
this a field in the edit form.
--
JR
--
John Rankin
More information about the pmwiki-users
mailing list