# Current tab in navigation

**URL:** <https://www.ruby-forum.com/t/current-tab-in-navigation/105680>\
**Category:** Radiant CMS\
**Created:** [June 1, 2007, 10:31am UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680 "2007-06-01T10:31:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 10:31am UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/1 "2007-06-01T10:31:23Z")

</div>

Hi,

I have a snippet where I store my navigation bar. It’s a bullet list,  
and I use CSS to make it looks like a bar, with each link as a button.

Is there a way to have this bar dynamic, where the correct button  
while be attached a “current” CSS class appropriately?

Thank you all.

J.

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 1:33pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/2 "2007-06-01T13:33:50Z")

</div>

Jonathan,

Take a look at the documentation for the \<r:navigation urls="’ \> tag.  
It should do everything you describe and a little more.

I’ve copied the docs to this bottom of this message, but if you’re on  
the current 0.6.0 or 0.6.1 version of Radiant you can find this  
documentation right in the new / edit page by clicking on the  
“Available Tags” reference link. Also note that if you’re NOT using  
0.6.1 (you should be 🙂 then you’ll find that the url separator  
character is a semi-colon (😉 not a pipe (|).

Good luck

\<r:navigation /\>

Renders a list of links specified in the urls attribute according to  
three states:

```
 * normal specifies the normal state for the link
 * here specifies the state of the link when the url matches the

```

current page’s URL  
\* selected specifies the state of the link when the current page  
matches is a child of the specified url

The between tag specifies what sould be inserted in between each of  
the links.  
Usage:

\<r:navigation urls="[Title: url | Title: url | …]"\>  
\<r:normal\>\<r:title /\>\</r:normal\>  
\<r:here\> **\<r:title /\>** \</r:here\>  
\<r:selected\> **\<r:title /\>** \</  
r:selected\>  
\<r:between\> | \</r:between\>  
\</r:navigation\>

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 3:06pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/3 "2007-06-01T15:06:01Z")

</div>

Loren J. wrote:

> “Available Tags” reference link. Also note that if you’re NOT using  
> 0.6.1 (you should be 🙂 then you’ll find that the url separator  
> character is a semi-colon (😉 not a pipe (|).

Actually, on 0.6.1 it’s a pipe not a simi-colon.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/4 "2007-06-01T17:10:27Z")

</div>

But that’s what I said 😉

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 6:21pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/5 "2007-06-01T18:21:36Z")

</div>

Thanks for the laugh, ya’ll.

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 7:06pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/6 "2007-06-01T19:06:40Z")

</div>

On 6/1/07, Loren J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> character is a semi-colon (😉 not a pipe (|).
> 
> Good luck

Again, that’s just what I needed. And yes, I run 0.6.1, and I will NOT  
not use the pipe :-p

Radiant and its community rock. Love it.

Thanks a lot.

J.

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 7:22pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/7 "2007-06-01T19:22:42Z")

</div>

But… but… the point is to YES USE THE PIPE IN 0.6.1 earlier  
versions NO

It’s getting funnier all the time 😉

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 7:29pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/8 "2007-06-01T19:29:44Z")

</div>

On Jun 1, 2007, at 1:21 PM, Loren J. wrote:

> > > Also note that if you’re NOT using  
> > > 0.6.1 (you should be 🙂 then you’ll find that the url separator  
> > > character is … not a pipe (|).

Double negatives are hard outside of code, too, I see.

Ha! adam

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 7:36pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/9 "2007-06-01T19:36:45Z")

</div>

No they’re not

😉

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 7:47pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/10 "2007-06-01T19:47:46Z")

</div>

> Double negatives are hard outside of code, too, I see.
> 
> Ha! adam

Yet another reason to stay away from !! in Ruby.

Sean

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 8:45pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/11 "2007-06-01T20:45:54Z")

</div>

Loren J. wrote:

> But that’s what I said 😉
> 
> On Jun 1, 2007, at 7:04 AM, John W. Long wrote:
> 
> > Loren J. wrote:
> > 
> > > “Available Tags” reference link. Also note that if you’re NOT using  
> > > 0.6.1 (you should be 🙂 then you’ll find that the url separator  
> > > character is a semi-colon (😉 not a pipe (|).  
> > > Actually, on 0.6.1 it’s a pipe not a simi-colon.

Wow. You’re right. You did. There were just too many nots, ors, andors,  
and xors in that statement. Not to mention pipes. 😉

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 1, 2007, 8:48pm UTC](https://www.ruby-forum.com/t/current-tab-in-navigation/105680/12 "2007-06-01T20:48:54Z")

</div>

Sean C. wrote:

> Yet another reason to stay away from !! in Ruby.

That is so !!true. 🙂 Except that I do like to use it to convert an  
expression into either true or false:

def open?  
!!@pipe #if pipe is nil convert it to false  
end

–  
John L.  
[http://wiseheartdesing.com](http://wiseheartdesing.com)
