Skip to content

Instantly share code, notes, and snippets.

@lukeholder
Last active December 24, 2015 03:19
Show Gist options
  • Save lukeholder/6737121 to your computer and use it in GitHub Desktop.
Save lukeholder/6737121 to your computer and use it in GitHub Desktop.
craft nav
Template Syntax Error
Unexpected tag name "endifchildren" (expecting closing tag for the "nav" tag defined near line 24)
/Users/lukeholder/Code/Work/teninacraft/craft/templates/_partials/_topbar.html(24)
22 {% set pages = craft.entries.section('pages').find() %}
23 {% nav page in pages %}
24 <li class="{% ifchildren %}has-dropdown{% endifchildren %}">
25 <a href="">{{ page.title }}</a>
26 {% ifchildren %}
27 <ul class="dropdown">
28 {% children %}
29 <li class="divider"></li>
30 </ul>
31 {% endifchildren %}
32 </li>
33 <li class="divider"></li>
34 {% endnav %}
{% set pages = craft.entries.section('pages').find() %}
{% nav page in pages %}
<li class="{% ifchildren %}has-dropdown{% endifchildren %}">
<a href="">{{ page.title }}</a>
{% ifchildren %}
<ul class="dropdown">
{% children %}
<li class="divider"></li>
</ul>
{% endifchildren %}
</li>
<li class="divider"></li>
{% endnav %}
@lukeholder
Copy link
Author

for anyone else that comes across this brandons example should be:

<li class="{% if craft.entries.descendantOf(page)|length %}has-dropdown{% endif %}">
|length not .length

@sjelfull
Copy link

sjelfull commented Oct 4, 2013

I know i'm going to need this later on, so thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment