This plugin requires:
- django-cms: https://github.com/divio/django-cms
- django-treebeard
- django-parler
- aldryn-translation-tools
Multiple named menus support for DjangoCMS
- Wojtek Kloc
- Grzegorz Biały
django-parler and django-treebeard integration based on code from: https://github.com/aldryn/aldryn-categories/
- Add
'multimenus'
to INSTALLED_APPS in your Django project's settings file. python manage.py migrate multimenus
.
First, create menu using panel in CMS main toolbar. See screenshots for details.
Display menu with Menu ID: NAVBAR_TOP
{% load multimenus %}
<ul>
{% show_multi_menu "NAVBAR_TOP" %}
</ul>
{% show_multi_menu MENU_ID "template.html" include_self=True %}
- you can override menu template using path as second parameter. Basic template code:
{% load multimenus %}
{% for item in items %}
<li>
<a href="{{ item.get_url }}"{% if item.target %} target="{{ item.target }}"{% endif %}>{{ item.title }}</a>
{% if item.get_children %}
<ul>
{% with items=item.get_children %}
{% include template %}
{% endwith %}
</ul>
{% endif %}
</li>
{% endfor %}
- include_self - boolean
By default, multimenus lists children of item matched by Menu ID. You can set include_self=True to include element.