The 'menus' folder will go in the 'templates' folder of your app.
This is a very simple example and does not include a Sub Menu . Which will follow.
This is a very simple example and does not include a Sub Menu . Which will follow.
{% load menu_tags %}
{% if menu_items %}
<nav class="nav-main">
<ul>
{% for item in menu_items %}
<li class="menu-item">
<a href="{{ item.href }}" class="icon {{ item.handle }}">{{ item.text }}</a>
</li>
{% endfor %}
</ul>
</nav>
{% endif %}
I've used 'handle' to store the class name I want, but this may not be suitable for you.
No comments:
Post a Comment