[pmwiki-users] Expanding lists using new Pagelist (:template:)

Ben Wilson dausha at gmail.com
Sat Jul 28 19:26:23 CDT 2007


On 7/28/07, Mike Shanley <thebarmy at omniversalism.com> wrote:
> Patrick R. Michaud wrote:
> > Just guessing:
> >
> >     (:template first {=$Group}:)
> >     * {=$Group}
> >     (:template each:)
> >     (:if equal {=$Group} {*$Group}:)** {=$FullName}(:if:)
> I've been working on this exact thing for like two hours. What you have
> listed doesn't work for me (at least in the sidebar). It only will
> display when I have navigated to the Site. group. Otherwise, nothing shows.
>
> Switching the (:template and the (:if helps, but not all the way.
> Instead of just showing the contents of the current group, it show
> what's inside every group:
>
> [[#expand]]
> (:template first {=$Group}:)
>
> *[[{=$Group}/]]
> (:if equal {*$Group} {=$Group}:)
> (:template each:)
> **[[{=$Group}/{=$Name}|{=$Titlespaced}]]
> (:ifend:)
> [[#expandend]]
>
> So how can we push this into full fledged 'working'?

Just looking at your markup, I would think the (:template each:)
supersedes the (:if equal:). That is, the (:template first:) is a
separate block from the (:template each:). Thus, the (:if equal:) is
ignored. If you're only getting the Site group, it sounds like you
have an error in your template that forces one of the {$Group}
PageVars to lock on Site, which is the group of the Site.SideBar page.

Pm's suggested markup worked for me perfectly. My pagelist:

(:pagelist link=Category.Sidebar fmt=#expand:)

My template:

[[#expand]]
(:template first {=$Group}:)
* [[{=$Group}]]
(:template each:)
(:if equal {=$Group} {*$Group}:)** [[{=$FullName}|{=$Titlespaced}]](:if:)
[[#expandend]]

In Action:
http://espacesociety.org/Chronology/Chronology

I just had to remember _not_ to put [[!Sidebar]] in the Group page,
which was the grief I was causing myself. That is, the Group.Group
page prefaced the top UL group, then appeared as the first element in
the nested UL group.

-- 
Ben Wilson
"Words are the only thing which will last forever" Churchill



More information about the pmwiki-users mailing list