[pmwiki-users] $BaseName (was Re: pmwiki-2.2.0-beta9 release (bugfix, pagevar filters in pagelists))

Patrick R. Michaud pmichaud at pobox.com
Tue Oct 3 11:17:58 CDT 2006


On Tue, Oct 03, 2006 at 10:31:30PM +1000, Kathryn Andersen wrote:
> On Mon, Oct 02, 2006 at 12:43:04PM -0500, Patrick R. Michaud wrote:
> > On Mon, Oct 02, 2006 at 11:32:27AM -0400, Crisses wrote:
> > This is now possible in 2.2.0-beta10 (just released), using
> > the new {$BaseName} page variable markup.
> 
> I'm a bit confused about what the $BaseName actually gives you, what it
> actually applies to.

Others have correctly answered your questions, but I figure that
since this is a new feature I should provide my own "official"
answers.

> Are the BaseNamePatterns applied to the $FullName of the page?
> Or the $Name of the page?

They're applied to the full name of the page.

> I don't understand the nested { } markup -- what does that do?
> [...]
> What if I had a page, say, "Stories-Highlander.DeadlySecrets"
> Does this mean that if I had
> 
>      $BaseNamePatterns['/^Stories-/'] = '';
> 
> Then the $BaseName of that page would be "Highlander.DeadlySecrets"?

Yes.

> What if I wanted just the "base group"?  (In this case, "Highlander")
> Would I be able to get that?

This is the purpose of the nested { } -- you would use

    {{$BaseName}$Group}

For a page like "Stories-Highlander.DeadlySecrets", 
{$BaseName} would become "Highlander.DeadlySecrets".  After
the substitution the above would then become

    {Highlander.DeadlySecrets$Group}

which is then evaluated to return the base group ("Highlander").

Pm




More information about the pmwiki-users mailing list