[pmwiki-users] Question about expanding menu (w/o additional scripts) :)

Martin Fick mogulguy at yahoo.com
Sun Sep 16 21:03:43 CDT 2007


--- Vladimir Grigor <vgrigor at gmail.com> wrote:

> Hi dear All! Need you help...
> 
> I want to implement 2 level menu in sidebar. 2nd
> level items link to pages in corresponding groups.
> 
> Suppose there are these pages in wiki:
> 
> Main.Homepage
> Research.Research
> Research.Projects
> Research.Funding
> Research.Join us
> Contacts.Contacts
> 
> And if user is on Main.Homepage (s)he sees following
> menu:
> -------
> Homepage
> Research
> Contacts
> =======
> 
> But if user browses pages in group Research
> (Research.*) then menu is this:
> -------
> Homepage
> Research
>   *Projects
>   *Funding
>   *Join us
> Contacts
> =======
> 
> I've read (probably) all (and recipes in
cookbook.menues also) what I
> could find about "expanding menu". It should be
possible to do it by
> Local Templates mechanism.
> 
> I try to implement it in the following way:
> 
> -------- code in Site.SideBar starts
> %sidehead% [[Main/HomePage]]
> (:pagelist fmt=#sidebar order=title
> name=Research.*,-HomePage :)
> * [[Contacts.Contacts]]
> ========= code ends
> 
> -------- code in Site.LocalTemplates starts
> [[#sidebar]]
> 
> (:template defaults order=name:)
> (:template first :)

you probably want
 (:template first {=$Group} :)

> %sidehead% [[{=$Group}]]
> (:template each:)
> * [[{=$Name}]]
> 
> [[#sidebarend]]
> ========= code ends
> 
> There is only one problem with this code - it
> doesn't work :)

What specifically doesn't work?  First make sure that
you get the set of pages  that you expect returned by
the pagelist (maybe with a default template), then
make sure that it filters them properly with your
template.

-Martin




      ____________________________________________________________________________________
Check out the hottest 2008 models today at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html



More information about the pmwiki-users mailing list