[pmwiki-users] Re: Re: Re: variables for customization

chr at home.se chr at home.se
Thu Jul 7 03:37:26 CDT 2005


On Wed, 6 Jul 2005, Patrick R. Michaud wrote:

> On Thu, Jul 07, 2005 at 01:36:15AM +0200, chr at home.se wrote:
> > Just checking... PmWiki.BasicVariables is supposed to document pmwiki's
> > PhP-variables, i.e. variables that are used by pmwiki.php. 
> 
> Yes.
> 
> > This is in
> > contrast to what I've referred to as "markup variables" that are available
> > in markup using e.g. "{$group}". 
> 
> Yes.
> 
> > Then we also have the variables that
> > FmtPageName() recognizes.. hmm, it's getting kind of complicated now :-)
> 
> I tend to call these latter items "substitutions", or even
> "variable substitutions" if you like.  There are some substitutions
> that are not variables, although almost every (non-array)
> variable can be used as a substitution.

We already have wiki pages for the "php variables", and I've started
PmWiki.MarkupVariables for "{$Group}", so I guess we just need to document
the "substitutions" available to FmtPageName(). For now, we could add
these details to PmWiki.Functions where I've written down some details
about how FmtPageName() works. Or maybe it deservers a page of its own?

> > Anyway, I'm surprised I hadn't noticed that $pagename is depreceated and 
> > that we should simply use $name in our scripts. And I also thought that 
> > $pagename was a normal variable, i.e. you do this
> 
> $pagename (the PHP variable) is not deprecated -- it still refers to the 
> current page, same as always.  
> 
> $PageName (the FmtPageName substitution used in v1, note the 
> capitalization) is deprecated, and is now just $Name.  

The thing that confused me was that php doesn't differentiate between 
$pagename and $PageName... Anyway, now I understand that when you write 
"$PageName" you mean the substitution, and with "$pagename" you mean the 
php variable.

> > PS. It'd be really convenient for writing scripts if '$name' and 
'$group' 
> > where available... I don't know how many times I've done this:
> > 
> > 	$group = FmtPageName("$Group", $pagename);
> 
> I understand how everyone wants this to be conveniently available.  
> But it can also be wrong, and confusing from another aspect.  
> Consider the following url:
> 
>     http://www.example.com/pmwiki/pmwiki.php
> 
> What value should $group and $name have when local/config.php is 
> called...?  And should scripts/recipes rely on those values?

Um... I'd expect $group to be assigned according to

 	$group = FmtPageName("$Group", $pagename);

which ought to be well defined even when accessing 

	http://www.example.com/pmwiki/pmwiki.php

Or am I missing something?  Anyway, I'll write more about this in another 
post.

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list