> Something like this may work:
> 
>  Markup('[[|~', '<[[|',
>    "/(?>\\[\\[([^|\\]]+))\\|\\s*\\~\\s*]]/e",
>    "Keep(MakeLink(\$pagename, PSS('$1'),
>      BestTitle(MakePageName(\$pagename,PSS('$1')))
>      ),'L')");
> 
>  function BestTitle ($pn) {
>    $sum = PageTextVar($pn,'Summary');
>    if (strlen($sum)) return $sum;
>    else return PageVar($pn, '$Title');
>  }

Thanks, Petko. That seems to work. 

If I don't run into problems, maybe I should post this as a recipe called "Best 
Title: Use A Page Text Variable For Link Text when available". However, if the 
"/e" only works for versions before PHP 5.5, then maybe I shouldn't. What do 
you think?

Randy
_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to