[pmwiki-users] (:title:) of (:include:) included pages overrides page title
Petko Yotov
5ko at 5ko.fr
Wed Feb 4 16:58:57 CST 2009
On Wednesday 04 February 2009 19:50:37 Patrick R. Michaud wrote:
> On Wed, Feb 04, 2009 at 07:03:58PM +0100, Petko Yotov wrote:
> > On Tuesday 03 February 2009 16:07:59 Oliver Betz wrote:
> > > * the page itself should IMO have top priority.
> > > * header and footer could be evaluated next
> > > * (:title:) from included pages should be controlled by a
> > > configuration. I would disable it.
> >
> > Excellent. I like very much these ideas, and I believe such a solution
> > will solve all currently percieved problems. I'll think about some
> > implementation, either Cookbook, or to the Core.
>
> I wonder if it works if we simply process the (:title:) markup
> before (:include:), and set it so that "first title wins".
Yes. This code seems to work :
Markup('title','<include',
'/\\(:title\\s(.*?):\\)/ei',
"PZZ(IsEnabled(\$GLOBALS['PCache'][\$pagename]['=p_title'], false) ||
PCache(\$pagename,
\$zz=array('title' => SetProperty(\$pagename, 'title', PSS('$1')))))");
This solution gives to the current page Top priority, and the first title
wins. It doesn't give priority to GroupFooter over other included pages, but
it should for GroupHeader and I believe it's fine.
We may find a better, simpler or shorter solution.
Petko
P.S. For some reason, on my wikis, such a setting in (farm)config.php or in
Group.php, seems to have no effect.
If I change it in stdmarkup.php, it works.
If I place both the new and the old markups in stdmarkup.php, the second
Markup() definition overrides the first one if I look at ?action=ruleset.
Shouldn't it be the first one? (2.2 beta65, beta68 and 2.2.0)
P.P.S. Same for http://pmwiki.org/wiki/Test/TitleInc?action=ruleset where I
enabled it: "title" is still in "directives".
More information about the pmwiki-users
mailing list