[pmwiki-users] New Hierarchical Groups Recipe...

The Editor editor at fast.st
Thu Feb 1 20:12:12 CST 2007


On 2/1/07, Kathryn Andersen <kat_lists at katspace.homelinux.org> wrote:

> > > (As an aside: I've found a problem with the $g1... variables and
> > > pagelists; they don't work.  I think I know what the problem is -- the
> > > variables are being set from the current pagename, they aren't taking
> > > a pagename and processing it -- but I won't be able to work on a fix
> > > until tonight or tomorrow)
> >
> > How else would you do it?  You would have to have something created
> > dynamically  when the pagelist is called.  Is this possible?
> > Evidently, as various other page variables are available in
> > pagelists...
>
> The $FmyPV variable needs to be defined as a call to a function which
> takes a group name or a page name as one of the arguments; that means it
> is dynamic and will be recalculated appropriately, and will work with
> pagelists.

Ok, that makes sense.  But how do you get it to take a group name?
something like

function hgsubgroup($x=$Group) {

Pardon the sloppy notation, just trying to get the idea..

It's also a bit tricky.  As it is, Hg generates the appropriate number
of pagevars dynamically based on the number of hyphens in the group
name.  In a pagelist, theoretically, that number would be variable
depending on the individual pages.  Would that mean each variable
would have to have a separate line calling the function, something
like

FmtPv [$g1] = ' hgsubgroup($x={$group}, level=1)  ';
FmtPv [$g2] = ' hgsubgroup($x={$group}, level=2)  ';

This would mean, it would only work to a predefined number of
levels--say 5 or 10, rather than unlimited.  Am I correct?

Of course, if it could automatically make these variables available to
a pagelist as it iterates through its pages, it would be worth it. I
would try and tackle it, but not sure I fully get it.

Cheers,
Dan



More information about the pmwiki-users mailing list