On our website, I implemented submenus the following way:

1. Create a submenu snippet:

<ul>
  <r:children:each>
    <li id="link_<r:slug/>"><r:link/></li>
  </r:children:each>
</ul>

This renders an unordered list of links to all children of a page. If 
some pages are to be excluded, you can do this by adding some 
<r:unless_url/> markup.

2. Create a content part "submenu" on each first levelpage that has 
children:

<r:find url="page_name">
  <r:snippet name="submenu"/>
</r:find>

This calls the above snippet with the current page selected so that the 
snippet will iterate over its children and render its submenu.

3. Include the content part in your layout

<r:content part="submenu" inherit="true"/>

The "inherit" attribute makes sure the submenu will be used on all child 
pages unless overridden.

It's a quick and rather non-DRY solution because you have to define the 
content part on each first level page and to manually enter the page 
title there, but from there everything works automatically. Highlighting 
etc. can be done with CSS - if you are interested, I can post some code.

Hope you can use it!

Cheers,
Wolfgang

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to