Filters a list of menu items on visibility and existance. Only top-level menu items that are both visible and exist are kept in the list. Note that sub-menus are not filtered, they need to be filtered separately.

The is_visible filter can’t be used due to the structure of a menu item list.


{% with|menu_is_visible as menu %}
        {% if menu %}
                {% for item in menu %}
                        <li>{{ }}</li>
                {% endfor %}
        {% endif %}
{% endwith %}

Edit on GitHub

menu_trail Menu menu_expand

Referred by


Filters transform template variables before they are rendered.