# How to make \<r:navigation.. keep "here" class on li

**URL:** <https://www.ruby-forum.com/t/how-to-make-r-navigation-keep-here-class-on-li/71424>\
**Category:** Radiant CMS\
**Created:** [October 8, 2006, 5:49pm UTC](https://www.ruby-forum.com/t/how-to-make-r-navigation-keep-here-class-on-li/71424 "2006-10-08T17:49:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 8, 2006, 5:49pm UTC](https://www.ruby-forum.com/t/how-to-make-r-navigation-keep-here-class-on-li/71424/1 "2006-10-08T17:49:52Z")

</div>

Does anyone have an idea on how to create a navigation menu using  
standard Radiant/Radius tags in which the parent item keeps a “here”  
class as long as any child, grandchild, great-grandchild, etc. is the  
current page?

Currently the \<r:navigation… tag doesn’t seem to accmodate this  
option.

I guess I could override and extend that tag, create my own, or  
perhaps accomplish this with just an iteration through the page tree  
using a combination of more elemental Radius tags?

Has anyone already addressed this situation. It should be common enough.

Thanks,

Loren J.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 9, 2006, 2:04am UTC](https://www.ruby-forum.com/t/how-to-make-r-navigation-keep-here-class-on-li/71424/2 "2006-10-09T02:04:31Z")

</div>

Loren J. wrote:

> Does anyone have an idea on how to create a navigation menu using  
> standard Radiant/Radius tags in which the parent item keeps a “here”  
> class as long as any child, grandchild, great-grandchild, etc. is the  
> current page?

Have you tried using “selected” within the navigation tag?

[http://radiantcms.org/blog/2006/06/15/tag-primer-2/](http://radiantcms.org/blog/2006/06/15/tag-primer-2/)

Thanks,

Bryan

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 9, 2006, 5:41pm UTC](https://www.ruby-forum.com/t/how-to-make-r-navigation-keep-here-class-on-li/71424/3 "2006-10-09T17:41:56Z")

</div>

Ok, I’ve been doing too many things at once.

The “\<r:selected” tag does handle this just fine. Sorry to waste  
bandwidth :-/

Bryan, thanks for the response before.

On Oct 9, 2006, at 8:41 AM, Loren J. wrote:

> \<r:selected\>
> 
> - \<r:title /\>
> \</  
> currently selected:  
> I think I’ve looked at the code for the navigation tag closely
> 
> > > the
> 
> * * *
> 
> Radiant mailing list  
> Post: removed\_email\_address@domain.invalid  
> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

Loren J.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 9, 2006, 4:41pm UTC](https://www.ruby-forum.com/t/how-to-make-r-navigation-keep-here-class-on-li/71424/4 "2006-10-09T16:41:46Z")

</div>

Yes I’m currently employing the selected tag under navigation, here  
is my current navigation code:

- 
- 
- 

This works fine if I a page is simply a child of a listed url,  
however if a page is a grandchild, great-grandchild, etc. then the  
parent/grandparent link is no longer in a selected state (I should  
have made that clearer).

See this link for a screenshot which shows the News “tab” currently  
selected:

[http://www.fn-group.com/clients/diopa/diopa\_news.jpg](http://www.fn-group.com/clients/diopa/diopa_news.jpg)

On this page tag/page you’ll see a series of links under the heading  
“Bishop’s Column” (November Article, December Article, etc.) If you  
were to click on December Article for instance the breadcrumb would  
read “Home \> News \> Bishop’s Column \> December Article” and the News  
“tab” should still be currently selected (though right now it  
wouldn’t be).

I think I’ve looked at the code for the navigation tag closely enough  
to now know that this isn’t an option as-is.

Are any additional options within the navigation control currently on  
the table? I would think that building-in some sort of option such as  
“selected\_if\_grandchild” could have universal application. If not,  
what would be my next best option?

Has anyone else dealt with this sort of nav scheme in Radiant yet?

Thanks,

Loren

On Oct 8, 2006, at 6:04 PM, Bryan wrote:

> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)  
> Loren J.  
> removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 9, 2006, 6:50pm UTC](https://www.ruby-forum.com/t/how-to-make-r-navigation-keep-here-class-on-li/71424/5 "2006-10-09T18:50:40Z")

</div>

Loren J. wrote:

> Ok, I’ve been doing too many things at once.
> 
> The “\<r:selected” tag does handle this just fine. Sorry to waste  
> bandwidth :-/
> 
> Bryan, thanks for the response before.

Loren,

I am glad to hear that it worked out. That tag gave me some trouble too  
when I first used it.

Bryan
