[pmwiki-users] How to change title to do only first one on page
Patrick R. Michaud
pmichaud at pobox.com
Wed Feb 15 10:38:33 CST 2006
On Wed, Feb 15, 2006 at 09:45:51AM -0600, Chris Cox wrote:
> Patrick R. Michaud wrote:
> >>Any way to put an 'if' inside the action below??
> >>
> >>## (:title:)
> >>Markup('title','>&',
> >> '/\\(:title\\s(.*?):\\)/ei',
> >> "PZZ(\$GLOBALS['PCache'][\$pagename]['title']=PSS('$1'))");
> >
> > Is this so that (:title:) inside of included pages isn't treated
> > as the current page's title?
> >
> > I'll quash that particular buglet in the next beta.
>
> Actually I kinda want the buglet. Just want to control
> whether it's last one in or first one in.
>
> I know we discussed that this side effect could be
> a potential feature. Something to consider.
Yeah, the fact that it's a possible feature is why I termed it
a "buglet" as opposed to a "bug". I'm still trying to work out
the correct handling for (:title:) in the face of includes.
Currently I see several possibilities:
- Leave things as they are now (arguably broken), where the
last (:title:) statement encountered is the one that counts.
- Change (:title:) so that the first (:title:) directive
encountered is the one that counts -- even if the first
(:title:) comes from an (:include:) statement.
- Use the "outermost" (:title:), i.e., a page's (:title:)
directive takes precedence over any (:title:) directives
in an included page. However, a page without a (:title:)
will use an included page's (:title:) if there is one.
- Never honor (:title:) in any included pages.
I see arguments for and against each of the above -- it's not
obvious how it should work.
And if we do decide to change it, there will be a
$Transition['title']=1; setting that restores the current
behavior for those who need it.
Pm
More information about the pmwiki-users
mailing list