Skip to content

Commit 7931d52

Browse files
Update menu_links jinja macro to check for item.target and render target attribute accordingly.
1 parent 407483d commit 7931d52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flask_admin/templates/bootstrap4/admin/layout.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
{% set class_name = item.get_class_name() %}
8181
{% if item.is_accessible() and item.is_visible() %}
8282
<li{% if class_name %} class="{{ class_name }}"{% endif %}>
83-
<a class="nav-link" href="{{ item.get_url() }}">{{ menu_icon(item) }}{{ item.name }}</a>
83+
<a class="nav-link" href="{{ item.get_url() }}"{% if item.target %} target="{{ item.target }}"{% endif %}>
84+
{{ menu_icon(item) }}{{ item.name }}</a>
8485
</li>
8586
{% endif %}
8687
{% endfor %}

0 commit comments

Comments
 (0)