am-impact / amnav

Navigation plugin for Craft
168 stars 19 forks source link

Custom Node Class Not Showing UP #43

Closed ghost closed 9 years ago

ghost commented 9 years ago

I am having trouble getting the custom node class to work.

I have added a custom node class to a menu item via the CP. However, it does NOT show up on the menu. Here is the code that I am using:

{% set nav = craft.amNav.getNavRaw("top_header") %}

{% macro addNodeToNavigation(node) %}
    <li{% if node.active %} class="current"{% endif %}>
        <a href="{{ node.url }}" title="{{ node.name }}"><div>{{ node.name }}</div></a>
        {% if node.hasChildren %}
            <ul>
                {% for subnode in node.children %}
                    {{ _self.addNodeToNavigation(subnode) }}
                {% endfor %}
            </ul>
        {% endif %}
    </li>
{% endmacro %}

<ul>
    {% for node in nav %}
        {{ _self.addNodeToNavigation(node) }}
    {% endfor %}
</ul>

Any idea why it is not working?

Thanks,

Moshe

hubertprein commented 9 years ago

Sorry for the late reply.

Please see the updated readme.