Fix category links across locales

This commit is contained in:
2026-05-04 20:18:30 +02:00
parent 210f90b899
commit df28667a9c

View File

@@ -1,16 +1,17 @@
{% load i18n ocyan_thumbnail %} {% load i18n ocyan_thumbnail mandelstudio_i18n %}
{% if menu_items %} {% if menu_items %}
{% for menu_item in menu_items %} {% for menu_item in menu_items %}
{% with category_icon=menu_item.category.icons.first %} {% with category_icon=menu_item.category.icons.first %}
{% with category_url=menu_item.get_absolute_url|language_neutral_path %}
{% if menu_item.has_children %} {% if menu_item.has_children %}
<li class="nav-item has_children"> <li class="nav-item has_children">
<a class="nav-link category-label" data-name="{{ menu_item.name|safe }}" data-href="{{ menu_item.get_absolute_url }}" tabindex="-1"> <a class="nav-link category-label" data-name="{{ menu_item.name|safe }}" data-href="{{ category_url }}" tabindex="-1">
<span>{% trans "Show everything in" %}</span>{{ menu_item.name }} <span>{% trans "Show everything in" %}</span>{{ menu_item.name }}
</a> </a>
<ul class="menu-level"> <ul class="menu-level">
{% else %} {% else %}
<li class="nav-item child"> <li class="nav-item child">
<a class="nav-link child-category" href="{{ menu_item.get_absolute_url }}" tabindex="-1"> <a class="nav-link child-category" href="{{ category_url }}" tabindex="-1">
{{ menu_item.name }} {{ menu_item.name }}
</a> </a>
</li> </li>
@@ -20,5 +21,6 @@
</li> </li>
{% endfor %} {% endfor %}
{% endwith %} {% endwith %}
{% endwith %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}