r:nav for the masses!

Haven't figured out a good way to build your navigation yet in radiant? Tired of updating and fixing your r:navigation tags? children:each can get you closer, but still doesn't quite cut it huh.. Have a go at this one;

<r:nav />

This will turn into a proper navigation to all published children of the homepage;

<ul>
<li class="current first"><a href="/cats/">Cat food</a></li>
<li><a href="/dogs/">Dog food</a></li>
<li><a href="/ants/">Ant food</a></li>
<li><a href="/aquariums/">Aquariums</a></li>
<li class="has_children"><a href="/info/">Pet food information</a></li>
<li><a href="/rss/">RSS feed</a></li>
</ul>

Woops.. we don't want that rss feed in there do we? Guess we'll have to give that page a new page part called 'no-map'.
If you want to change the order of the links, just use the reorder extension.

Different site, different needs. Let's see what else this baby can do.

<r:nav root="/products" id="nav_products" depth="2" />

Wooaah! Look at that!

<ul id="nav_products">
<li class="parent_of_current has_children first"><a href="/products/masks/">Masks</a>
<ul>
<li class="current"><a href="/products/masks/threatning/">Threatning</a></li>
<li><a href="/products/masks/bulletproof/">Bulletproof</a></li>
<li><a href="/products/masks/sexy/">Sexy</a></li>
</ul></li>
<li><a href="/capes/">Capes</a></li>
<li><a href="/tights/">Tights</a></li>
</ul>

And there's even more attributes to set, for all your css hooking needs.
You must be bathing in eagerness to try this out yourself by now. Grab the extension on Github, and have a look at the readme for more options.

Have something to add?



  • (required, but not displayed)

  • (optional)

About this article

You’re reading an entry titled “r:nav for the masses!”. Written

undefined tag `time_ago_in_words'
ago (05/02/2008) — and archived under extensions, navigation, radiant. So far, 0 people (dis)agreed with me, what do you think?

What the fuzz is all about

  1. 2 pages are tagged with WYM
  2. 1 page is tagged with absolute-urls
  3. 1 page is tagged with arrrrcamp
  4. 2 pages are tagged with documentation
  5. 2 pages are tagged with editor
  6. 2 pages are tagged with extension
  7. 2 pages are tagged with extensions
  8. 1 page is tagged with minitorial
  9. 1 page is tagged with navigation
  10. 10 pages are tagged with radiant
  11. 4 pages are tagged with rails
  12. 2 pages are tagged with ruby
  13. 2 pages are tagged with shell
  14. 1 page is tagged with sifr
  15. 2 pages are tagged with troubleshooting

Github activity

More places where you can find me

Back to top