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

V.Krishn webmaster at insteps.net
Mon Sep 11 12:35:32 CDT 2006

On Monday 11 September 2006 21:11, Patrick R. Michaud wrote:
> 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.

How about a backslash to say - hold on... get the variable as variable. 
I mean the php style, less its starts getting too cryptic.


> > 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
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users

More information about the pmwiki-users mailing list