Travu

A flexible bootstrap 3 theme

Back to Travu Support

core.teamelite21203
core.teamelite21203

Was it because of it is boostrap 3 that right after the latest octobercms update the menu drop down has not been working? at the nav.htm, the code has been the same that I have never changed. the dropdown failed after latest octobercms update.

{# Note: Only one levels of sublinks are supported by Bootstrap 3 #}
{% set
    links = {
        'pages': {
            name: 'Pages',
            sublinks: {
                'signin':        ['samples/signin', 'Sign In'],
                'error':         ['error', 'Error Page'],
                '404':           ['404', '404 Page'],
            },
        },
        'about': ['samples/about', 'About'],
        'blog': ['blog/blog', 'Blog'],

    }
%}

{% macro render_menu(links) %}
    {% for code, link in links %}
        <li class="{{ code == currentPage ? 'active' }} {{ link.sublinks ? 'dropdown' }}">
            <a
                href="{{ link.sublinks ? '#' : (link.page ?: link[0])|page }}"
                  {% if link.sublinks %}data-toggle="dropdown"{% endif %}
                class="{{ link.sublinks ? 'dropdown-toggle' }}"

            >
                {{ link.name ?: link[1] }}
                {% if link.sublinks %}<span class="caret"></span>{% endif %}
            </a>
            {% if link.sublinks %}
                <span class="dropdown-arrow"></span>
                <ul class="dropdown-menu">
                    {{ _self.render_menu(link.sublinks) }}
                </ul>
            {% endif %}
        </li>
    {% endfor %}
{% endmacro %}

{% import _self as nav %}

{{ nav.render_menu(links) }}

Then I tried the code in the comment for the dropdown menu at the header.htm(line 47-53)

 <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">More Pages <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="sidebar-left.html">Left Sidebar</a></li>
                            <li class="active"><a href="sidebar-right.html">Right Sidebar</a></li>
                        </ul>
                    </li>

It worked for that. But the dropdown menu for nav.htm failed. Why ?

Last updated

1-1 of 1