am-impact / amnav

Navigation plugin for Craft

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Class for items with no children

waswebb opened this issue · comments

Hi

I use your plugin for a project in witch i should have the option to give a li tag with no children a class like no-children. Like the included class has-children.

That would be great if you can help me.

You'd be able to do this with the getNavRaw sample: https://github.com/am-impact/amnav#build-the-way-you-like-it

{%- if node.hasChildren -%}
    {%- set nodeClasses = nodeClasses|merge(['has-children']) -%}
{% else }
    {%- set nodeClasses = nodeClasses|merge(['no-children']) -%}
{%- endif -%}