[pmwiki-users] Fwd: About {$:var} text-variables

Patrick R. Michaud pmichaud at pobox.com
Mon Sep 11 10:41:48 CDT 2006


On Mon, Sep 11, 2006 at 11:10:37AM -0400, The Editor wrote:
> > The problem is that page variables without a pagename qualifier
> > always refer to the currently browsed page, not the page that contains
> > the page variable.
> [-snip-]
> > In other words, {$var} always refers to the page in which it is
> > written, and {.$var} always refers to the page in which it is displayed.
> > Most of the time these are in fact the same.
> 
> I understood this much.  Perhaps my question is why we don't switch
> those markups to preserve backward compatibility.  That is, keep
> {$var} referring to the currently browsed page and {.$var} referring
> to the page from which it is written.  

...because it's backwards from what authors expect.  The natural
markup should be the one without the dot.  In general we introduce
page variables like {$Name}, {$Group}, {$Title}, etc., and those
are the ones we should naturally expect authors to use.  

The "special" case is when we really want the Title of the currently
browsed page, and thus the special case should have the special markup.

> 2.  The page variables (by me at least) are use almost exclusively in
> headers, footers, etc, where I want the existing function. 

GroupHeader and GroupFooter, or the headers and footers of the
skin?  Either way, the existing function is likely to continue to
work in these cases.

> 3.  The "." seems to suggest root, which has a semantic connection to
> the root page, not the secondary page (the page being browsed).
> Easier to remember, perhaps.

Actually, "." usually has the semantics of "current", not "root".

> 4.  It puts the burden of knowing this extra syntax on those doing
> more advanced stuff, with simpler syntax being used for more simple
> stuff (like groupheaders/footers).

I think this actually gets the burden backwards -- the simpler
syntax is already being used for the simpler stuff.  Believe me,
after looking at pagelist templates and other items, everyone expects
{$var} to refer to the page it's in, not the one that includes it.

> Just a thought.  It will not be onerous to have to change my site, but
> would prefer to avoid it if possible.  

Given that {$Name} and {$Group} continue to work the same in
GroupHeader, GroupFooter, and skin templates, how much would
you have to change?

Pm




More information about the pmwiki-users mailing list