Add content to a menu depending on the child/parent? page?

Hello,

I would like to do the following with a radiant site I’m trying to
build.

sidebar contains a menu:

  • news
  • band
  • history
    etc.

the menu is build from all the children of the ‘top’ page, so I have
the following for the sidebar:
<r:find url="/">
<r:children:each order=“asc”>

What I would like to do (but don’t know how to do yet) is to add
content to the menu when I’m visiting a certain page.

i.e. when currently on the band page, you see:

  • news
  • band
    • trumpet
    • piano
    • bass
  • history

And when on the news page, you see

  • news
    • current
    • very old
  • band
  • history

So that would mean my sidebar should be adding content depending on
whether the page your looking at matches a certain child/parent?.

Any thoughts on how to do this (from radiant?)
Or should I be looking at writing a plugin to get this done?

Best regards,

Jeroen J.

Given the following tag (just the inverse of the “unless_self” tag
defined by Sean in a recent thread):

tag “if_self” do |tag|
tag.expand if tag.globals.actual_page == tag.locals.page
end

Seems that it could be as easy as:

<r:find url="/">
<r:children:each order=“asc”>

...
/AITOR

Hi,

Thanks very much! This works exactly as I need it.
Any hopes of getting this in the next version of radiant?

Jeroen

Any hopes of getting this in the next version of radiant?

In the meanwhile you can do it with the back door extension with
something
in the line of:

<r:if cond=“tag.globals.actual_page == tag.locals.page”>

</r:if>

/AITOR