[Pmwiki-users] Re: Variable names

Patrick R. Michaud pmichaud
Mon Oct 18 08:39:16 CDT 2004


On Mon, Oct 18, 2004 at 09:19:22AM -0500, Jonathan Scott Duff wrote:
> > These are too long--variables that are used frequently (and $Group and
> > $Name are by far the most commonly used items in templates) should
> > be short and easy to remember.  Also, $CurrentPage itself would be 
> > confusing -- does it refer to just the name component of the page or 
> > the page's full name?  I'm very likely to leave $Name and $Group as
> > they are, although I might switch to $FullPageName instead of $PageName.
> 
> I'll just note that I too dislike $Name.  For reasons similar to why you
> dislike the term "user" in fact  :)  

Indeed.  But read on.

> In a system where you have well-defined concepts of pages and groups,
> $Group makes sense, but $Name does not. I suggest $Page instead.

There are several problems with $Page -- the biggest being
that, for obvious reasons, there are a *lot* of variables that begin
with "Page" ($PageEditFmt, $PageNameChars, $PageNotFound, $PageUrl,
$PageAttributes, etc.).  Thus, in order for this to work the '$Page'
substitution would really need to take place *after* checking for
all of the other substitutions, or we do some pattern trickery to make
the '$Page' we see isn't part of something larger.

Beyond that, conceptually I've always felt that the term "page" includes
the group it's in -- i.e., people will normally think of Main.WikiSandbox as 
a different "page" from PmWiki.WikiSandbox, even though they have the 
same "name".

Of course, PmWiki 1 uses "$Title" for this, which works okay except that
"title" means something different in the context of HTML (<title>...</title>)
and doesn't work at all if a page can specify its own [:title:], so 
I switched to $Name.  It's not too late to switch to something else, but
it needs to be demonstrably clearer.

Pm



More information about the pmwiki-users mailing list