esentino / djangocms-multimenus

Multiple tree menus for DjangoCMS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Multiple tree menus for DjangoCMS

License:MIT License


Languages

Language:Python 97.3%Language:HTML 2.7%