templates: mark selected menu item with a title for a11y (#40864)

This commit is contained in:
Frédéric Péters 2020-03-20 15:59:35 +01:00
parent 3baed95c28
commit 27ce2bbaeb
1 changed files with 2 additions and 0 deletions

View File

@ -1,8 +1,10 @@
{% load i18n %}
{% if menuitems %}
<ul>
{% spaceless %}
{% for menuitem in menuitems %}
<li data-menu-page-id="{{ menuitem.page_id }}" class="menu-{{ menuitem.page.slug }} {% if menuitem.selected %}selected{% endif %}"><a
{% if menuitem.selected %}title="{{ menuitem.page.title }} - {% trans "active page" %}"{% endif %}
href="{% page_absolute_url menuitem.page %}"><span>{{ menuitem.page.title }}</span></a>
{% if depth > 1 %}
{% show_menu current_page=menuitem.page level=-1 depth=depth reduce_depth=True ignore_visibility=ignore_visibility %}