-
-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Description
not finding a way to properly render dropdown menu items, I've had the need to complement render_nav_item by render_dropdown_item to add items to bootstrap dropdown menus.
the quickly hardcoded version is below, i can adapt it to provide the use_li conditional
{% macro render_dropdown_item(endpoint, text, _badge='', _badge_classes='badge text-bg-light') %}
{% set active = True if request.endpoint and request.endpoint == endpoint else False %}
<li>
<a class="dropdown-item{% if active %} active" aria-current="page{% endif %}"
href="{{ url_for(endpoint, **kwargs) }}">
{{ text }} {% if _badge %}<span class="{{ _badge_classes }}">{{ _badge }}</span>{% endif %}
</a>
</li>
{% endmacro %}
would that be interesting as a PR ?
Metadata
Metadata
Assignees
Labels
No labels