Navigation - current page tree branch/section

Let’s say I have a page hierarchy like this:

  • about

  • publications

    • css

    • webdesign

  • contact

and I use navigation tag in order to produce top navigation like this:

    <r:navigation urls=“About: /about; Publications: /publications; Contact:
    /contact”>

    <r:normal>

  • <r:title />
  • </r:normal>

    <r:here>

  • <r:title

    />

  • </r:here>

    </r:navigation>

When I’m on ‘css’ page I would like to still have class=‘current’ on

‘publications’ in order to inform my users in which page tree
branch/section

they are…

Is there an easy way to achieve this using this tag (I mean

‘navigation’)? If not what would be the easiest way?

Thanks in advance for suggestions.

Bartek

From http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/
models/page_context.rb :

<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>

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 inbetween each

of the links.

I believe what you’re looking for is the “selected” tag.

James

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs