custom/plugins/TcinnThemeWareLiving/src/Resources/views/storefront/layout/header/actions/language-widget.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/header/actions/language-widget.html.twig' %}
  2. {# TODO: prüfen... #}
  3. {# ---------------- START: SET TEMPLATE VARS ---------------- #}
  4. {# ThemeWare: Set theme variables #}
  5. {% set twtHeaderType = theme_config('twt-header-type') %}
  6. {% set twtHeaderTopBarJustifyContent = theme_config('twt-header-top-bar-justify-content') %}
  7. {# ---------------- END: SET TEMPLATE VARS ---------------- #}
  8. {# TODO: HC-Architecture... #}
  9. {# ThemeWare: Changes on the language-menu-dropdown #}
  10. {# TODO:
  11.     - Default-Konfiguration ergänzen...
  12.     - Check if this can be solved with scss...
  13. #}
  14. {% block layout_header_actions_languages_widget_form_items %}
  15.     {% if twtHeaderType == 4 or twtHeaderTopBarJustifyContent == 'flex-start' %}
  16.         <div class="top-bar-list dropdown-menu dropdown-menu-left"
  17.              aria-labelledby="languagesDropdown-{{ position }}">
  18.             {% for language in  page.header.languages %}
  19.                 <div class="top-bar-list-item dropdown-item{% if language.id is same as(page.header.activeLanguage.id) %} item-checked{% endif %}"
  20.                      title="{{ language.translated.name }}">
  21.                     {% block layout_header_actions_languages_widget_form_items_flag %}
  22.                         {% set isoCode = language.translationCode.code|lower|split('-') %}
  23.                         {% set flagCountry = isoCode[0] %}
  24.                         {% set flagLanguage = isoCode[1] %}
  25.                         <label class="top-bar-list-label"
  26.                                for="{{ position }}-{{ language.id }}">
  27.                             <input id="{{ position }}-{{ language.id }}"
  28.                                    class="top-bar-list-radio"
  29.                                    value="{{ language.id }}"
  30.                                    name="languageId"
  31.                                    type="radio"
  32.                                     {% if language.id is same as(page.header.activeLanguage.id) %} checked{% endif %}>
  33.                             <div class="top-bar-list-icon language-flag country-{{ flagCountry }} language-{{ flagLanguage }}"></div>
  34.                             {{ language.name }}
  35.                         </label>
  36.                     {% endblock %}
  37.                 </div>
  38.             {% endfor %}
  39.         </div>
  40.     {% else %}
  41.         {# Default block #}
  42.         {{ parent() }}
  43.     {% endif %}
  44. {% endblock %}