Hmmm, there is obviously something I am missing with regards to
<r:if_self> and <r:if_ancestor_or_self> and Radiant 0.6.6.
I’ve made a little menu, and it works just fine, except that all cases
of <r:if_self> are simply ignored, and a blank space is inserted in my
rendered html.
In the case of <r:if_ancestor_or_self> a:
“
undefined method `url’ for nil:NilClass
”
is rendered for each child element, and the class is also not inserted
here either.
---- My Menu —
<li id="<r:slug />" class="current"
>
<li id="<r:slug />"
class="here"
>
Anybody know why this isn’t working like I expect it to? I imagine it’s
an assumption of mine…
In any case, thanks in advance!
Nancy
Nancy,
I’m not sure why they do not work for you or where that error comes
from, but here’s a couple tips.
Your inner <r:unless_content> is a duplication of logic from the outer
scope. I think you probably want it on the inside of the inner
<r:children:each>.
If you want to use the title of the page in a link to the page, just use
<r:link />, not <r:link><r:title /></r:link>. The title is the default
text of the link.
Using <r:title /> in the id attribute for the submenu might break the
prohibition on spaces in that attribute. <r:slug /> would be a better
choice.
Sean
Hi Sean,
Thanks for your tips! I’ve applied them all except the one about
<r:unless_content>. I have pages on both levels that I would prefer not
show up in the menu, and I couldn’t convince the outer one to filter the
inner ones as well. Unfortunately, nothing has changed with regard to
<r:if_self> et al.
I’ll keep trying though, and thanks again.
Nancy
Sean C. schrieb: