# menu\_is\_visible

Source: https://zotonic.com/docs/1948/menu_is_visible

URI: https://zotonic.com/id/1948

Language: en



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 <a href="/id/doc_template_filter_filter_is_visible" class="doc-reference doc-reference-filter"><code>filter#is_visible</code></a> filter can’t be used due to the structure of a menu item list.

Example:

```django
{% with m.rsc.main_menu.menu|menu_is_visible as menu %}
        {% if menu %}
        <ul>
                {% for item in menu %}
                        <li>{{ item.id.title }}</li>
                {% endfor %}
        </ul>
        {% endif %}
{% endwith %}
```

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1948?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1948?language=en>)
