custom/plugins/FourtwosixThemeExtension/src/Resources/views/storefront/layout/header/logo.html.twig line 1

Open in your IDE?
  1. {% sw_extends'@Storefront/storefront/layout/header/logo.html.twig' %}
  2. {% block layout_header_logo_image %}
  3.     {% set boedenSalesChannelIdFromConfig = config('FourtwosixThemeExtension.config.boedenSalesChannelId') %}
  4.     {% set italianLanguageIdFromConfig = config('FourtwosixThemeExtension.config.languageIt') %}
  5.     {% set ftsPavimenti24MediaId = config('FourtwosixThemeExtension.config.ftsPavimenti24Media') %}
  6.     {% set isBoeden = context.salesChannelId == boedenSalesChannelIdFromConfig %}
  7.     {% set isItalianLanguage = context.languageId == italianLanguageIdFromConfig %}
  8.     {% set mediaCollection = searchMedia([ftsPavimenti24MediaId], context.context) %}
  9.     {% set pavimenti24MediaURL = mediaCollection.get(ftsPavimenti24MediaId).url %}
  10.     {# @fourtwosix-edit: change the logo only for Boeden Italian and check if mediaURL is set #}
  11.     {% if(isBoeden and isItalianLanguage and ftsPavimenti24MediaId) %}
  12.         {% set mobileLogo = pavimenti24MediaURL %}
  13.         {% set tabletLogo = pavimenti24MediaURL %}
  14.         {% set desktopLogo = pavimenti24MediaURL %}
  15.     {% else %}
  16.         {% set mobileLogo = theme_config('sw-logo-tablet') |sw_encode_url %}
  17.         {% set tabletLogo = theme_config('sw-logo-mobile') |sw_encode_url %}
  18.         {% set desktopLogo = theme_config('sw-logo-desktop') |sw_encode_url %}
  19.     {% endif %}
  20.     {# @fourtwosix-edit: end ------------------------------------------------ #}
  21.     <picture class="header-logo-picture">
  22.         {% block layout_header_logo_image_tablet %}
  23.             {% if theme_config('sw-logo-tablet') and theme_config('sw-logo-tablet') != theme_config('sw-logo-desktop') %}
  24.                 {# @fourtwosix-edit:  changed the url of the picture src #}
  25.                 <source srcset="{{ tabletLogo }}" media="(min-width: {{ theme_config('breakpoint.md') }}px) and (max-width: {{ theme_config('breakpoint.lg') - 1 }}px)">
  26.                 {# @fourtwosix-edit: end ------------------------------------ #}
  27.             {% endif %}
  28.         {% endblock %}
  29.         {% block layout_header_logo_image_mobile %}
  30.             {% if theme_config('sw-logo-mobile') and theme_config('sw-logo-mobile') != theme_config('sw-logo-desktop') %}
  31.                 {# @fourtwosix-edit:  changed the url of the picture src #}
  32.                 <source srcset="{{ mobileLogo }}" media="(max-width: {{ theme_config('breakpoint.md') - 1 }}px)">
  33.                 {# @fourtwosix-edit: end ------------------------------------ #}
  34.             {% endif %}
  35.         {% endblock %}
  36.         {% block layout_header_logo_image_default %}
  37.             {% if theme_config('sw-logo-desktop') %}
  38.                 {# @fourtwosix-edit:  changed the url of the picture src #}
  39.                 <img src="{{ desktopLogo }}" alt="{{ "header.logoLink"|trans|striptags }}" class="img-fluid header-logo-main-img"/>
  40.                 {# @fourtwosix-edit: end ------------------------------------ #}
  41.             {% endif %}
  42.         {% endblock %}
  43.     </picture>
  44. {% endblock %}