[pmwiki-users] Cluster: Restrict Page Lists to only "top" groups ($g1)

Kathryn Andersen kat_lists at katspace.homelinux.org
Wed Feb 14 06:17:32 CST 2007


On Wed, Feb 14, 2007 at 01:49:06AM -1000, Sivakatirswami wrote:
> OK I installed cluster... marvelous..
8-)

> New challenge: I want to  get a page list where we only
> have the "top" home page for each cluster.
> and where home pages follow the default format  of $Group=$Name
> e.g.
> 
> MailLists.MailLists
> MailLists-Invitations.MailLists-Invitations
> MailLists-Maintenance.MailLists-Invitations
> MailLists-Configuration.MailLists-Invitations
> 
> Mangos.Mangos
> Mangos-TreeCultivation.Mangos-TreeCultivation
> Mangos-IceCream.Mangos-IceCream
> 
> Pets.Pets
> Pets-Cats.PetsCats
> Pets-Fish-Koi.Pets.Fish.Koi
> 
> I want to get a page list  of  only the Matriarchs
> 
> MailLists.MailLists
> Mangos.Mangos
> Pets.Pets

I have two things that help with this.
One is a very useful $SearchPatterns definition, which lists only group
home pages:

$SearchPatterns['group'][] = '/([-\w]+)\.\1$|\.' . "$DefaultName" . '$/';

The other is to take advantage of the $g0 variable, to list only groups
which have only one part to their name.

(:pagelist list=group $g0=1 ...:)

What I use to get a "dynamic menu" is the following:

fmt=#hgtitle2

Two-level list of groups (showing title), giving nested hierarchical
groups of top two levels; assumes that list=group

[@
[[#hgtitle2]]
(:if ( !equal "{<$g1}" "{=$g1}" and equal "{=$g0}" "1" ):)
*[[{=$Group}.|{=$GroupTitle}]]
(:if ( ( equal "{<$g1}" "{=$g1}" and equal "{=$g1}" "{*$g1}" ) and equal "{=$g0}" "2" ) :)
**[[{=$Group}.|{=$GroupTitle}]]
(:ifend:)
[[#hgtitle2end]]
@]

This creates a list of all the top-level groups, and a sub-list of
level-2 groups which match the current "Matriarch" (to use your term).

> from those pages, users can navigate to "sub-groups" in the cluster
> ( hmmm.. aside: we need to come up with a lexicon for this recipe, terms 
> of discourse
> nomenclature for "top of cluster" "children" etc...  )

Yes.  Hmmmm.
 
Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe



More information about the pmwiki-users mailing list