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

Nancy Carroll wrote:
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:
"<div><strong>undefined method `url' for nil:NilClass</strong></div>"
is rendered for each child element, and the class is also not inserted here either.

---- My Menu ---
<div id="navigation">
 <r:find url="/">
 <ul>
<r:children:each><r:unless_content part="navhide"> <li id="<r:slug />" <r:if_self>class="current"</r:if_self> ><r:link><r:title /></r:link>
       <r:if_children>
       <r:unless_content part="navhide">
           <ul id="<r:title />-submenu">
              <r:children:each>
<li id="<r:slug />" <r:if_ancestor_or_self>class="here"</r:if_ancestor_or_self> ><r:link><r:title /></r:link></li>
              </r:children:each>
           </ul>
       </r:unless_content>
       </r:if_children>
   </li>
   </r:unless_content>
   </r:children:each>
   </ul>
 </r:find>
</div>

------

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








_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to