[pmwiki-users] pagelist is creating links relative to the current group?

Pico pmwiki at ben-amotz.com
Wed May 24 15:20:03 CDT 2006

Patrick R. Michaud <pmichaud <at> pobox.com> writes:
> On Wed, May 24, 2006 at 05:20:15PM +0000, Pico wrote:
> > Patrick R. Michaud <pmichaud <at> pobox.com> writes:
> > > it a bit, I've decided to introduce a {$GroupHome} page variable, 
> > > which returns the current "home page" for a group.  
> > 
> > This seems to work great for pagelists, but I notice that when you test the
> > variable on a group that doesn't have a home page (or doesn't use the default
> > page as given by $PagePathFmt) that the {$GroupHome} variable does not return
> > anything, i.e.
> > 
> > {Cookbook.$GroupHome}    => Cookbook.Cookbook
> > {Main.$GroupHome}        => nothing (where Main.HomePage exists)
> > {NoSuchGroup.$GroupHome} => nothing (where no home pages exist)
> Note that "Cookbook.", "Main.", and "NoSuchGroup." aren't valid
> pagenames, so they can't be used before the '$GroupHome'.  Try instead
>     {Cookbook.XYZ$GroupHome}
>     {Main.XYZ$GroupHome}
>     {NoSuchGroup.XYZ$GroupHome}

Ok, I see: the format is not {Group.$GroupHome} or {Group$GroupHome} but rather,
it is {Group.Page$GroupHome}, which can be shortened to {Page$GroupHome}, with
the caveat that the page will be assumed to reside in the current group (whether
that page actually exists, or not).

> The key is that what comes before the $ has to be a valid pagename
> in the group you want.  (It doesn't matter if the page exists, just
> that it be a valid pagename in the desired group.)

Ok, so it is completely arbitrary what page I refer to, existing or otherwise,
as long as I identify it as a page that exists, or doesn't, within the group
that I am interested in.  

If that is the case, could the underlying code just assume (or supply) the
arbitrary page name when the author specifies the group, i.e. could the entry of
the markup {Group.$GroupHome} or  be interpreted as {Group.XYZ$GroupHome}

But it is still confusing why I could use the format {Group.$GroupHome} (with no
page specified) and have that work when Group.Group exists, but not work when
only Group.HomePage exists.  What is going on?  When I specify only "Group." in
{Group.$GroupHome) is it looking for Group.Group, or it is looking for
Group.[Null]?  If it is looking for Group.Group, which is a valid page name, why
does it only work when Group.Group exists, and why does it fail when Group.Group
does not exist.

> > Can you explain what makes this work on PageLists?  
> > (and provide any other info that we can use to document this).
> In a pagelist, the template uses  {=$GroupHome}  and the '=' is
> always replaced by the full name of the current page in the list.
> Since this is a valid pagename, it works.
> Pm

Right, that part was clear.  



More information about the pmwiki-users mailing list