[Fixed]-Django-simple-menu integration with bootstrap

1👍

You have to make a new template and include it after the {% if item.children %} tag. Something like:

<li class="{% if item.selected %}active{% endif %} {% if item.children %}dropdown dropdown-toggle{% endif %}">
    <a href="{{ item.url }}">
        {{item.title}}
    </a>
    {% if item.children %}
        {% include 'base/navbar-sub.html' with items=item.children %}
    {% endif %}
</li>

And then, yout navbar-sub would be something like:

{% load menu %}
<ul class="dropdown-menu">
    {% generate_menu %}
    {% for item in items %}
        {% if item.visible %}
            <li class="{% if item.selected %}active{% endif %}">
                <a href="{{ item.url }}">
                {{item.title}}
                </a>
            </li>
        {% endif %}
    {% endfor %}
</ul>

Leave a comment