[pmwiki-users] Bug in (:title:) markup?

Hans design5 at softflow.co.uk
Sun Jan 27 05:16:31 CST 2008


> Maybe it is worth to consider that changing 'the last (:title:) win' to 'the first
> (:title:) win'?

Here is a modified title markup, which sets the title with the first
(:title:) directive encountered and ignores subsequent title
directives.

Add this to config.php, you do not need to change stdmarkup.php:

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


With this you don't need to set conditionals to check the page name,
just use the (:title:) markup normally.


  ~Hans




More information about the pmwiki-users mailing list