[pmwiki-users] USe PTVs instead of directives (was (:title:) of (:include:) included pages overrides page title)

Eemeli Aro eemeli at gmail.com
Wed Feb 25 15:06:34 CST 2009

2009/2/25 Kathryn Andersen <kat_lists at katspace.homelinux.org>:
> On Wed, Feb 25, 2009 at 10:20:30PM +0200, Eemeli Aro wrote:
>> 2009/2/25 Kathryn Andersen <kat_lists at katspace.homelinux.org>:
>> > On Wed, Feb 25, 2009 at 07:30:51PM +0200, Eemeli Aro wrote:
>> And I agree that they aren't page text variables, but my point is that
>> they ought to be.
> And my point is that they shouldn't be, because they have extra
> semantics which makes them unlike ordinary PTVs, and if you represented
> them as PTVs, people would be confused, because they would behave
> differently to ordinary PTVs.

I don't see how they'd behave any differently from other page text
variables. The only internal magic that happens is that if set, they
may more often than other variables be read by stuff in a skin
template or another place such as PrintMetaTags().

>> Can you explain a bit more how this breaks your
>> site? Is it just a matter of having similarly-named page text
>> variables on your site?
> I use "Title:" as a PTV, and in many cases, it is explicitly different
> from the page title.  For example, I might have
> (:title Way (Back) Around:)
> Title:The {$Title}

If that's the case, then there isn't actually any naming conflict
here, as page text variables are case-sensitive and the title etc.
have lower case keys. If you look at the $FmtPV definition in
pmwiki.php, you can see that eg. {$Title} actually maps to
$page['title'] and so forth; the corresponding page text variables are
also lower-case. Hence your example would work exactly as it does now
with the following:

(:title:Way (Back) Around:)
Title:The {$Title}

Or, referring directly to the page text variable:

(:title:Way (Back) Around:)
Title:The {$:title}


More information about the pmwiki-users mailing list