Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 1.7 KB

README.md

File metadata and controls

77 lines (54 loc) · 1.7 KB

djangocms-multimenus

This plugin requires:

Multiple named menus support for DjangoCMS

Authors

  • Wojtek Kloc
  • Grzegorz Biały

django-parler and django-treebeard integration based on code from: https://github.com/aldryn/aldryn-categories/

Installation

  1. Add 'multimenus' to INSTALLED_APPS in your Django project's settings file.
  2. python manage.py migrate multimenus.

Usage

First, create menu using panel in CMS main toolbar. See screenshots for details.

django-multimenus1

django-multimenus2

Template

Display menu with Menu ID: NAVBAR_TOP

{% load multimenus %}

<ul>
    {% show_multi_menu "NAVBAR_TOP" %}
</ul>

Templatetag parameters

{% 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.