Main menu icons missing from translated anonymous home page

Created on 7 July 2023, over 1 year ago
Updated 19 July 2023, over 1 year ago

Problem/Motivation

The 2 icons (Home, Catalogue) are missing when the anonymous home page is rendered in a different language and the words "Home" and "Catalogue" are translated with different form than their English variants.

The reason is that the CSS class that adds the icon is computed by using the menu link text, in templates/menu/menu–main.html.twig:

{{ link(link_html, item.url, {'class':['main-menu__link', item.title|replace({' ': '_'})|lower], 'title': item.title }) }}

As item.title is no more "Home" or "Catalogue" this end up in referring classes that doesn't exist. CSS is defining .home and .catalogue.

Steps to reproduce

  • Add a new language
  • Make sure the words "Home" and "Catalogue" are translated an their translation is different than their English variants
  • As anonymous visit the homepage.

Check that the icons are missing.

Proposed resolution

Compute the class name from the menu link plugin ID as that doesn't vary with the language.

Remaining tasks

None.

User interface changes

N/A

API changes

None

Data model changes

None

πŸ› Bug report
Status

Downport

Version

3.1

Component

Code

Created by

πŸ‡·πŸ‡΄Romania claudiu.cristea Arad πŸ‡·πŸ‡΄

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024