How can you create multiple menus with django-cms

I'm trying to have two separate menus in my django-cms app. One for the header and another with a different set of links for the footer:

[ Logo ]        Link_A Link_B Link_C Link_D


          ... content ...


      Link_E Link_F Link_G Link_H

Using baked in {% show_menu %}, will show all of the pages registered, links A - H, and doesn't allow me to separate the two menus.

How can I create two separate menus?

Answers


Depends what you want to do really, but I've got a base template which has a navigation menu at the top and a sitemap submenu at the bottom.

So starting with the navigation;

{% show_menu 1 100 100 100 "partials/navigation.html" %}

Which uses the template;

{% load cms_tags menu_tags cache cms_page %}

{% for child in children %}

    <li>
        <a href="{{ child.attr.redirect_url|default:child.get_absolute_url }}">
            {{ child.get_menu_title }}
        </a>
        {% if child.children and child.level <= 4 %}
            <ul>
                {% show_menu from_level to_level extra_inactive extra_active template '' '' child %}
            </ul>
        {% endif %}
    </li>

{% endfor %}

Then the sitemap;

{% show_sub_menu 2 1 1 "partials/sitemap.html" %}

And sitemap.html

{% load cms_tags cms_page cache %}

{% if children %}

    {% for child in children %}

        <ul class="site-footer__column">
            <li>
                <h4>
                    <a href="{{ child.attr.redirect_url|default:child.get_absolute_url }}">
                        {{ child.get_menu_title }}
                    </a>
                </h4>
            </li>

            {% if child.children %}
                {% for baby in child.children %}

                    <li class="footer_sub">
                        <a href="{{ baby.attr.redirect_url|default:baby.get_absolute_url }}">
                            {{ baby.get_menu_title }}
                        </a>
                    </li>
                {% endfor %}
            {% endif %}

        </ul>

    {% endfor %}
{% endif %}

Understanding the options (numbers) you can provide for a menu can enable you to display different parts of your site, but if the built in menu tags don't suit your needs, you could write a custom menu tag.

The standard menu docs are here; http://docs.django-cms.org/en/3.2.2/reference/navigation.html

And here are the docs for customising your menus; http://docs.django-cms.org/en/3.2.2/how_to/menus.html


Need Your Help

How to link activity to element of a spinner?

android android-spinner

I am creating a spinner given in the code as follow. How can i connect it to another activity(say Bangalore.java). I tried the something available on stackoverflow but its not working.

Grails Portlets for Liferay

grails portlet

I'm actively developing grails portlets for liferay till today .