[pmwiki-users] LocalTemplates title weirdness

Lars Eighner surname at larseighner.com
Sat Mar 2 13:53:09 CST 2013


On Sat, 2 Mar 2013, Maria McKinley wrote:

This is just a thought:

It is possible that you are somehow including a page that has a title,
perhaps in a footer you have forgotten about.

Try this in your config.php:

## (:title ...:) First title wins, any subsequent (:title ...:) is ignored.
Markup('title','directives',
   '/\\(:title\\s(.*?):\\)/ei',
   "SetTitleMarkup(\$pagename, PSS('$1')) ");
function SetTitleMarkup($pagename, $arg) {
    static $tset = 1;
    $arg = str_replace('$','$',htmlspecialchars($arg, ENT_NOQUOTES));
    if ($tset==1)
       PCache($pagename, $zz=array('title' => SetProperty($pagename, 'title', $arg )));
    $tset++;
}

I'd like to credit that little snippet but I don't remeber where I got it --
only that I did not write it.

Unless you have a special reason for wanting included pages to seize the
title, and I can't imagine what such a reason might be, that snip can stay
in config.php in case some day someone, like you, or something, like a
plug-in, includes a page in your article.



-- 
Lars Eighner
http://www.larseighner.com/index.html
8800 N IH35 APT 1191 AUSTIN TX 78753-5266




More information about the pmwiki-users mailing list