[pmwiki-users] pagelist is creating links relative to the current group?
Patrick R. Michaud
pmichaud at pobox.com
Wed May 24 17:53:21 CDT 2006
On Wed, May 24, 2006 at 08:20:03PM +0000, Pico wrote:
> 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}
Not as things exist now. What happens is that when given something
like {<string>$PageVariable}, PmWiki first uses the MakePageName
function to convert <string> into a valid pagename (relative to
the current group, if necessary). This is exactly the same logic
that is used for converting [[<string>]] to a pagename -- i.e.,
it looks first in the current group, and if not found there it
searches to see if there are default group pages that could be
used (as indicated by the $PagePathFmt variable).
At the moment, converting something like "Cookbook." to a pagename
results in an invalid pagename, there's nothing after the dot.
So, we could conceivably adjust the MakePageName() function to
treat a trailing dot in a name as meaning "return the group's
default page, whatever it happens to be".
Then we'd have the following situation (assume these links are
in Test.XYZ):
[[ABC]] -- links to the first of Test.ABC, ABC.ABC, or ABC.HomePage
if they exist. If none of them exist, links to Test.ABC.
[[ABC.]] -- links to ABC.ABC or ABC.HomePage if they exist, otherwise
links to the site-configured default for the ABC group.
In other words, a trailing dot always indicates a group. Interestingly,
this means we no longer need the {$GroupHome} page variable, since
we can always get a group's home page by using the trailing dot notation.
I think that works for me. I have no idea what this could potentially
break in existing sites -- I suspect nothing would break, but I have
been surprised by such things before.
> 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?
I think your test must've been flawed somewhere-- I haven't been able to
duplicate the results you got.
Pm
More information about the pmwiki-users
mailing list