[pmwiki-users] pagelist is creating links relative to the current group?
Patrick R. Michaud
pmichaud at pobox.com
Wed May 24 14:32:12 CDT 2006
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}
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.)
> 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
More information about the pmwiki-users
mailing list