I used to recommend the <r:navigation> tag, but nowadays, I'm thinking
body-ids combined with some dynamic CSS might work best.  I might do
something like this in the layout:

<body id="page_<r:id />">

Then in a separate (Radiant-stored) stylesheet, I would do something like this:

<r:find url="/">
  <r:snippet name="page_menu_highlight" />
</r:find>

Then in the snippet named "page_menu_highlight":

#page_<r:id/> #link_to_<r:id/> { font-weight: bold; } // or whatever
you want to use to highlight.
<r:children:each>
  <r:snippet name="page_menu_highlight" />
</r:children:each>

Then when generating your menu items, set the id on each item to
#link_to_<r:id/>.

If you have pretty much static menu options, <r:navigation/> is
arguably better, however.

Sean

On 9/25/07, Richard Hurt <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> I've got my Radiant shell up and running and I'm trying to figure things
> out.  One thing I've run across is building a menu and highlighting the
> current page.  Here's what I have right now.  It works but it's really
> really messy.  I guess I could put it into a snippet or something but it
> still seems like the hard way to do it.  I looked at the <r:navigation>
> stuff but I think that just works with children pages, correct?
>
> <div id="menu">
>   <ul>
>     <r:if_url matches="^/$"><li id="current"><a
> href="/">Home</a></li></r:if_url>
>     <r:unless_url matches="^/$"><li><a href="/">Home</li></r:unless_url>
>
>     <r:if_url matches="^/products"><li id="current"><a
> href="/products">Products</a></li></r:if_url>
>     <r:unless_url matches="^/products"><li><a
> href="/products">Products</li></r:unless_url>
>
>    ... etc ...
>
>   </ul>
> </div>
>
>
> Basically, I'm trying to single out the current page so that I can apply a
> CSS id to it.  That id causes the menu item to be bold and give you the
> feeling that your really on the page.
>
> I know it's probably something really stupid, but instead of messing with it
> for 3 days I thought I would ask you guys for some help.
>
> Thanx!
>   Richard
>
>
> BTW: The page I'm working on is at http://mail.kangaroobox.com:3000/.  Don't
> abuse me too much.  :)
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
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