[Moin-user] Collapsible list macro

Jim Wight j.k.wight at ncl.ac.uk
Wed Mar 31 07:38:56 EDT 2010


Paul Moore wrote:
> I'm looking for a means of adding a "collapsible menu" to my wiki.
> I've searched the Macro market, and various other places on the web,
> but haven't been able to find anything. Before I start writing my own,
> does anyone know of an existing bit of code that does this?

My SeeSaw macro can do it.

> Basically, I currently have a list in my wiki
> 
>   * Title 1
>    * SubPageOne/SubSubOne
>    * SubPageOne/SubSubTwo
>    * SubPageOne/SubSubThree
>   * Title 2
>    * SubPageTwo/SubSubOne
>    * SubPageTwo/SubSubTwo
>    * SubPageTwo/SubSubThree
> 
> At the moment, this renders as a normal 2-level bulleted list. What
> I'd like is for the list to initially render as only the top level
> entries (Title 1, Title 2) and clicking on a top level entry to expand
> it, showing the sublist below it. (The top level entries don't need to
> be links to pages themselves).

The markup would be:

  * <<SeeSaw(title1, "Title 1")>>
  {{{#!wiki seesaw title1
   * SubPageOne/SubSubOne
   * SubPageOne/SubSubTwo
   * SubPageOne/SubSubThree
}}}
  * <<SeeSaw(title2, "Title 2")>>
  {{{#!wiki seesaw title2
    * SubPageTwo/SubSubOne
    * SubPageTwo/SubSubTwo
    * SubPageTwo/SubSubThree
}}}

I've implemented it at the SeeSaw demonstration site at 
http://seesaw.ncl.ac.uk/1.9/JimWight

Jim




More information about the Moin-user mailing list