Coder Social home page Coder Social logo

djangocms-multimenus's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.