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

Patrick R. Michaud pmichaud at pobox.com
Wed May 24 18:09:53 CDT 2006

On Wed, May 24, 2006 at 12:11:13PM -0700, H. Fox wrote:
> I'm pleased to see the pagelist links to non-existent group home pages
> fixed.  I think it will be especially helpful for inexperienced
> authors because linking to CurrentGroup.OtherGroupName was confusing.
> FWIW, as an author I would have expected these to display the names of
> the home pages for the respective groups:
>    Main.{$GroupHome} => Main.HomePage
>    PmWiki.{$GroupHome} => PmWiki.PmWiki
>    GroupWithNoHomePage.{$GroupHome} =>
>      GroupWithNoHomePage.GroupWithNoHomePage

Page variables never depend on anything that appears immediately
before or after the variable, so this would seem to break that
rule.  Essentially the {$GroupHome} page variable would have to
look at its text immediately prior to decide if it's to report
based on the current page's group (as all other page variables do)
or some other group.

But I'm growing to very much like Pico's suggestion of using a 
trailing dot (and presumably slash as well) to refer to a group's 
home, whatever it happens to be.  Then we can do things like 
[[Main.]] or [[Main/]] to always refer to the default page of 
another group, even if a page of the same name exists in the
current group.

If we need to get the page's true name or some other attribute, 
we can put the group as part of the page variable:

    {Main.$FullName} => Main.HomePage
    {Main.$Name}  => HomePage
    {Main.$PageUrl} => .../pmwiki.php/Main/HomePage

Interestingly, this also presents another solution to the problem
of "how do I access an attachment in another group", since we
can then do  Attach:Main./image.gif.  (OTOH, because of the way
uploads are structured by default it might still be worthwhile to
have the Attach: markup assume that a non-existent simple name
reference is referring to a group and not a page in the current

> Put another way, it would be nice to be able to link to another
> group's home page without knowing what that home page's name is, or
> even if it exists.

The trailing dot approach seems to elegantly allow this.


More information about the pmwiki-users mailing list