Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Creating a gallery tree menu

hairballopolis edited this page Sep 13, 2010 · 1 revision

In order to create a representation of the structure of the galleries to allow access to them

  • Gallery 01
    • Sub Gallery 01
      • Sub Sub Gallery 01
      • Sub Sub Gallery 02
    • Sub Gallery 02
  • Gallery 02

You will need create 2 snippets, the first is the setup ‘main’ part and the second is the recursive ‘snippet’ that walks the tree and returns the desired results.

Main: Either a snippet or the page you wish to display the tree

<div id='menu'>
    <r:galleries:each level='top'>
        <r:snippet name='galleries'/>
    </r:galleries:each>
</div>

Snippet: ‘galleries’

<ul>
    <li><r:gallery:name/><r:gallery:url/></li>
    <r:gallery:if_children>
        <r:gallery:children:each>
            <r:snippet name='galleries'/>
        </r:gallery:children:each>
    </r:gallery:if_children>
</ul>

This will return a structure as diagramed at the beginning.

Clone this wiki locally