[pmwiki-users] Hierarchical Pages Revisited [Was: Navigation to "Sub-Groups"]

The Editor editor at fast.st
Sun Jan 21 07:18:18 CST 2007


TO LIST:  See my suggestion to Sivakatirswami below.  I wonder if some
kind of (better) syntax couldn't be developed using this approach as a
way to simulate hierarchical pages in PmWiki...  It has powerful
potential--without requiring any kind of rewrite of PmWiki... Any
thoughts?


On 1/21/07, Sivakatirswami <katir at hindu.org> wrote:
> I'm struggling with the absence of a 3rd level in PMwiki's hierarchy.
> Put another way: as has oft been asked "Can we have sub-groups"  Ok the
> answer is NO.. so I've set up model for project management where
> sub-groups are based on file nomenclature, using the "stem" model which
> is already used universally in so many contexts (URI for example) and
> naive users easily "digest" and understand a structure like this, which
>  just looks visually like any domain-realm-site-pages model:
>
> MailLists.MailLists
> MailLists-Invitations.MailList-Invitations
> MailLists-Maintenance.MailList-Maintenance
> MailLists-FAQ.MailLists.FAQ
>
> etc.
>
> This is actually working out quite  will as using wildcard for
> "group=MailLists*"  aggregates all
> "subgroups" in page list conditionals.
>
> but a problem arises if the user is located at a "sub-level"
>
> e.g.
>
> MailLists-Maintenance.DelegationOptions
>
> I want to have a menu-form select drop down that will allow the user to
> navigate "up and across" to other sub-groups.
>
> This works, but only if I am in the "top Mother group" MailLists.MailLists
>
> ---------
> Go To Related Projects: (:input form:)(:select+ project:)(:option :)Jump
> To Page(:pagelist group={$Group}* name={$Group}*
> fmt="#selectlistpages":)(:selectend:)(:input end:)
> ----------
>
> I get a nice drop  down menu to select and go  to:
>
> MailLists.MailLists
> MailLists-Invitations.MailList-Invitations
> MailLists-Maintenance.MailList-Maintenance
> MailLists-FAQ.MailLists.FAQ
>
> But this is dependent on my being on some page in the "Mother" group
> "MailLists"
>
> If I am on this "child" (sub-project-group) Home Page:
>
> MailLists-Invitations.MailList-Invitations
>
> I can't figure  out how to declare a conditional that will deliver a
> page list for all groups under
> "MailList"   Since  the  {$Group} is "MailLists-Invitations"
> group={$Group}* will fail to
> get me all the "subgroups" under "MailLists*"
>
> In another programming language would just set a delimiter to "-", parse
> the first item
> which would then return "MailLists*" in all cases.
>
> How do I do that in PMwiki?
>
> stating yet again: if I am here:
>
> MailLists-Invitations.InputCGI
>
> how can I generate, from that page,
>  a pagelist of the "home pages" for related projects?
>
> MailLists.MailLists
> MailLists-Invitations.MailList-Invitations
> MailLists-Maintenance.MailList-Maintenance
> MailLists-FAQ.MailLists.FAQ
>
> Our model is such that  there is *always* a home page where Group=Name
> which is the PMwiki default. So that's dependable.
>
> I could use:
> ---------
> Go To Related Projects: (:input form:)(:select+ project:)(:option :)Jump
> To Page(:pagelist group={$Group}* name={$Group}-*
> fmt="#selectlistpages":)(:selectend:)(:input end:)
> ----------
>
> But this will fail to pick up pages in the top level
> "MailLists.MailLists" which has no dash in the group name.


You could perhaps create a custom page variable in a config file and
use that.  Here's a code sample to give you an idea (others can
suggest better code...)

$mygroup = FmtPageName('$Group', $pagename);
$mygroups = explode("-", $mygroup);
foreach ($mygroups as $g => $gg) $FmtPV["$$g"] = "'" . $gg . "'";

To use, paste this in your config.php.  Then, go to page
Test1-Test2-Test3-Test4.Test and put {$0} {$1} {$2} {$3} into the
page.  It returns Test1, Test2, Test3 and Test4 for the page
variables.  I tested it on my site and it works great.  Kind of neat
actually...

To use your example, if you are at MailLists-Invitations and you want
a pagelist of all the MailLists pages, you would use group={$0}.

Cheers,
Dan




More information about the pmwiki-users mailing list