[pmwiki-users] Cluster in Pagelists- Getting 1st Level Groups only

Kathryn Andersen kat_lists at katspace.homelinux.org
Sat May 12 00:14:03 CDT 2007


On Fri, May 11, 2007 at 02:25:09PM -1000, Sivakatirswami wrote:
> But, I need to upgrade my Cluster calls in page lists.
> 
> '''All Projects:'''
> (:input form:)
> (:pagelist group=-Pmwiki,-Site,-Team,-TODO*,-XToDo* $g0=1 fmt="#jumpbox":)
> (:input end:)
> 
> I don't get any form at all...

I can't reproduce this.
For me, what I get with this is a jumpbox which contains a list of all
pages which belong to top-level groups.

If you're trying to make it give a list of *just* the top-level *groups*
only, then you need to add something else to restrict that.  What I find
useful myself is to add another list filter in my local/config, which
lists only group home pages.

In local/config.php:
#make a group-only Group.Group search pattern
$SearchPatterns['group'][] = '/([-\w]+)\.\1$|\.' . "$DefaultName" . '$/';

In your wiki page:
(:input form:)
(:pagelist group=-Pmwiki,-Site,-Team,-TODO*,-XToDo* list=group $g0=1 fmt=#jumpbox:)
(:input end:)
 
This would give you a list of the top-level groups (but only those
groups which actually have home pages).

If that isn't what you want, then I've probably misunderstood.

> if I remove:
> 
> $g0=1
> 
> then it works, but I get  all pages and in no particular order either.

Yes, that would happen.
 
> I tried:
> 
> (:pagelist group=-Pmwiki,-Site,-Team,-TODO*,-XToDo* $g1 fmt="#jumpbox":)
> 
> but that doesn't work either.

If you wanted to check for the contents of $g1, then you would need to
do {$g1}, but I don't think that would give you what you want anyway.
 
> I would like to get either just a list of the top level kingdom
> home pages
> 
> HTDE (which goes to HTDE.HTDE)
> WebContent (which goes to WebContent.WebContent)
> 
> etc...
> 
> Or even better yet a cascading menu with
> 
> HTDE
> 	HTDE-Statistics
> 	HTDE-MainApp
> 	HTDE-SubscriberDBase

----
!!!fmt=#hgtitle2

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

[@
[[#hgtitle2]]
(:template defaults order=group list=group:)
(:template first {=$g1}:)
(:if equal "{=$g0}" "1" ):)
*[[{=$Group}.|{=$GroupTitle}]]
(:ifend:)
(:template first {=$g2}:)
(:if ( equal "{=$g1}" "{*$g1}" and equal "{=$g0}" "2" ) :)
**[[{=$Group}.|{=$GroupTitle}]]
(:ifend:)
[[#hgtitle2end]]
@]
 
Note that this requires the $SearchPatterns setting that I gave above.

> I have the latest Cluster recipe, but I guess we need
> a syntax upgrade too but I can't figure it out
> from the current docs at Pmwiki.org

I'm very puzzled, because it works as expected for me.  That is, when I
do the first example you gave, it does not behave for me the way that it
behaved for you, so I think there must be something else wrong.
(Yes, I am using 2.2beta45 also)

What values are you getting for $g0?

If you go to your Main.WikiSandbox and go

$g0={$g0}

then what result do you get?  It should be displaying

$g0=1

(since this is Main, a level-1 group)

If you get

$g0=

then I would suspect that Cluster hasn't been
detected/installed/activated or something similar.

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