我正在尝试修复网站上出现的错误我维护www.kenyabuzz.com顶部导航无法获得子元素。这是我认为{{ children }}
缺失的顶级导航的代码。
{% recursetree top_menu %}
<li{% if node.slug == '' %} id="nav-home"{% endif %} class="stackAuto">
<a href="{% if node.url_override %}{{ node.url_override }}{% else %}{{ node.get_absolute_url }}{% endif %}" title="{{ node.title }}" class="stackContent{% if node.id == page.id or node.id == page.parent.id %} current{% endif %}">
{% if node.slug == '' %}<img src="{{ STATIC_URL }}kb/img/kenya-buzz-logo.gif" alt="Home" />{% else %}{{ node.name }}{% endif %}
</a>
</li>
{% endrecursetree %}
答案 0 :(得分:1)
绝对缺少{{ children }}
。您的代码可能是:
{% recursetree top_menu %}
<li{% if node.slug == '' %} id="nav-home"{% endif %} class="stackAuto">
<a href="{% if node.url_override %}{{ node.url_override }}{% else %}{{ node.get_absolute_url }}{% endif %}" title="{{ node.title }}" class="stackContent{% if node.id == page.id or node.id == page.parent.id %} current{% endif %}">
{% if node.slug == '' %}<img src="{{ STATIC_URL }}kb/img/kenya-buzz-logo.gif" alt="Home" />{% else %}{{ node.name }}{% endif %}
</a>
{% if not node.is_leaf_node %}
<ul class="menu children">
{{ children }}
</ul>
{% endif %}
</li>
{% endrecursetree %}