Hi Loren,
I ended up solving this particular problem a different way, but the
original
issue is still a pain.
This part in particualr is where I’m losing you:
the problem in that case are the r:link & r:content bits referring to
the current page rather than the page I’m creating a link.
Can you clarify this part and I might be able to help. I’m currently
implementing a site in Radiant which is requiring plent of
<r:navigation… tags and is crying for some more automated options that
still have some r:navigation style “selected” and “here” class tagging.
Here is (I hope) a lucid description. What I found is that inside an
r:children:each tag, one has full access to each child’s data: title,
url,
link, slug, content, etc. The drawback with r:children:each is that the
ability to order and filter the child is, errr, rather primative.
The navigation tag on the other hand allows complete manual control over
the
items looped over. The drawback is that inside a navigation tag one
doesn’t
actually have access to the pages being referred to. For example, here
is a
simple nav component for doodads. /doodads/ is the main doodad page, and
it
has perhaps 10 children, each of which is a different doodad detail page
(doodad-1, doodad-2, … doodad-n). The component is meant to be shown
on
the doodad overview and detail pages, and should highlight the doodad
page
we are on, if we are on a doodad detail page.
This works great as a snippet with one huge exception- the <r:content>
tags
refer to whatever page the user is looking at, not to the urls fed in by
the
navigation tag. I was wrong about the link tag not working here, it
does.
I ended up solving the problem using children:each and some css to get
around the lack of normal/here/selected tags. By setting the pages body
id="<r:slug />" and the div.item ids to each doodad’s r:slug it became
easy
to write CSS to “activate” any div.item whose id == body’s id.
body# #doodad-selector .item# {
background-color:
#ffc }
body# #doodad-selector .item# h3 { color: #333 }
Doodad
Nav
<r:children:each by="title">
<r:link><div class="item" id="<r:slug />">
<h3><r:title /></h3><r:content part="navline" /></div>
</r:link>
</r:children:each>
</r:find>
That worked well for my purposes, but I would still love to have a
navigation tag that refers to actual pages rather than title/url pairs.
Or
maybe better would be an <r:foreach> tag which operates on a list of
pages
or the children of some page, and allows here / selected matching
inside.
All in all though Radiant has offered elegant solutions for most aspects
of
the site I’m building.
Jim