Navigation drop-down problem Doing my first site with Craft and UiKit framework I encountered a small problem with dropdown menu. Here is my code:

&lt;ul&gt;
  {% set entries = craft.entries.section('spb') %}
  {% nav entry in entries %}
  &lt;li class="uk-parent" data-uk-dropdown&gt;
    &lt;a {% if craft.request.getPath() == entry.uri %} class="active" {% endif %} href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
    {% ifchildren %}
    &lt;div class="uk-dropdown"&gt;
      &lt;ul class="uk-nav uk-nav-dropdown"&gt;
        {% children %}
      &lt;/ul&gt;
    &lt;/div&gt;
    {% endifchildren %}
  &lt;/li&gt;
  {% endnav %}
&lt;/ul&gt;


The point is that my child element looks exactly like parent because it takes its structure. But I don't need neither "class" nor "data-uk-dropdown" element...

&lt;li class="uk-parent" data-uk-dropdown=""&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;


Is there any workaround? Thanks.
You can use entry.level in a conditional:

{% set entries = craft.entries.section('spb') %}
{% nav entry in entries %}

    {% set liTagAttributes = entry.level == 1 ? 'class="uk-parent" data-uk-dropdown' : 'class="uk-child"' %}

    &lt;li {{ liTagAttributes|raw }}&gt;
        &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
        {% ifchildren %}
            ...
        {% endifchildren %}
    &lt;/li&gt;

{% endnav %}


I set a intermediate var to keep the template code clean. If you don't have many levels in your structure, you could also consider to not use the nav tag at all and nest your navigation levels using hasDescendents and getDescendents(1) (see the example code I posted here).