custom/plugins/ThemeOkeonline/src/Resources/views/storefront/layout/header/header-content-renderer.html.twig line 1

Open in your IDE?
  1. {% set headerContent  = headerContent ? headerContent : 'none' %}
  2. {% set headerImage = headerImage ? headerImage : false %} {# e.g. theme_config('headerStylesLayoutHeaderTopImage')#}
  3. {% set headerLocation = headerLocation ? headerLocation : 'general' %} {# e.g. top, center, bottom, bottomTail #}
  4. {% if headerContent == 'none' %}
  5.     <!--empty-->
  6. {# Deprecated, please use dedicated categories-1, categories-2, categories-3 and categories-4 slots #}
  7. {% elseif headerContent == 'categories' %}
  8.     {% block header_deprecated_categories_wrapper %}
  9.         {% if(page.footer.navigation.tree) %}
  10.             {% for root in page.footer.navigation.tree|filter((u) => u.category.translated.name|lower in theme_config('headerStylesLayoutHeaderFooterCategories')) %}
  11.                 {% block layout_header_actions_center_extra_link %}
  12.                     <div class="header-action d-none d-md-flex">
  13.                         <div class="header-action-extra-link">
  14.                             <a class="header-extra-link-btn header-actions-btn ml-3 mr-3 {% if root.children %} dropdown-toggle{% endif %}" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  15.                                 {{ root.category.translated.name }}
  16.                             </a>
  17.                             {% if root.children %}
  18.                                 <div class="dropdown-menu list-unstyled" aria-labelledby="dropdownMenuLink">
  19.                                     {% for treeItem in root.children %}
  20.                                         {% set category = treeItem.category %}
  21.                                         {% set name = category.translated.name %}
  22.                                         {% set externalLink = category.translated.externalLink %}
  23.                                         {% block layout_header_actions_center_navigation_information_link_item %}
  24.                                             <div class="header-extra-menu-dropdown-link-item">
  25.                                                 {% block layout_header_actions_center_navigation_information_link %}
  26.                                                     <a class="menu-link" href="{% if externalLink %}{{ externalLink }}{% else %}{{ seoUrl('frontend.navigation.page', { navigationId: category.id }) }}{% endif %}" title="{{ name }}">
  27.                                                         {{ name }}
  28.                                                     </a>
  29.                                                 {% endblock %}
  30.                                             </div>
  31.                                         {% endblock %}
  32.                                     {% endfor %}
  33.                                 </div>
  34.                             {% endif %}
  35.                         </div>
  36.                     </div>
  37.                 {% endblock %}
  38.             {% endfor %}
  39.         {% endif %}
  40.     {% endblock %}
  41. {% elseif headerContent == 'image' %}
  42.     {% block header_image_wrapper %}
  43.         <div class="header-{{ headerLocation }}-content header-{{ headerLocation }}-{{ headerContent }}">
  44.             {% block header_image_content %}
  45.                 {% if headerImage %}
  46.                     <img src="{{ headerImage|sw_encode_url }}" alt="{{ "header.logoLink"|trans|striptags }}" class="img-fluid header-top-image-img"/>
  47.                 {% endif %}
  48.             {% endblock %}
  49.         </div>
  50.     {% endblock %}
  51. {% elseif headerContent == 'usps' %}
  52.     {% block header_usps_wrapper %}
  53.         {% set uspKeys = uspKeys ? uspKeys : ['one', 'two', 'three'] %}
  54.         <div class="header-{{ headerLocation }}-content header-{{ headerLocation }}-{{ headerContent }}">
  55.             {% block header_usps_content %}
  56.                 <ul class="list-inline list-unstyled">
  57.                     {% for uspKey in uspKeys %}
  58.                         {% block header_usp_wrapper %}
  59.                             <li class="usp-item list-inline-item">
  60.                                 {% block header_usp_content %}
  61.                                     {{ ("oo.header"~ headerLocation|capitalize ~".usps.usp" ~ uspKey|capitalize)|trans|striptags }}
  62.                                 {% endblock %}
  63.                             </li>
  64.                         {% endblock %}
  65.                     {% endfor %}
  66.                 </ul>
  67.             {% endblock %}
  68.         </div>
  69.     {% endblock %}
  70. {% elseif headerContent == 'text' %}
  71.     {% block header_snippet_wrapper %}
  72.         <div class="header-{{ headerLocation }}-content header-{{ headerLocation }}-{{ headerContent }}">
  73.             {% block header_snippet_content %}
  74.                 <span>
  75.                     {{ ("oo.header"~ headerLocation|capitalize ~".text.text")|trans|striptags }}
  76.                 </span>
  77.             {% endblock %}
  78.         </div>
  79.     {% endblock %}
  80. {% elseif headerContent == 'rating' %}
  81.     {% block header_rating_wrapper %}
  82.         <div class="header-{{ headerLocation }}-content header-{{ headerLocation }}-{{ headerContent }}">
  83.             {% block header_rating_content %}
  84.                 [ rating ]
  85.             {% endblock %}
  86.         </div>
  87.     {% endblock %}
  88. {% elseif headerContent starts with 'categories' %}
  89.     {% block header_categories_wrapper %}
  90.         <div class="header-{{ headerLocation }}-content header-{{ headerLocation }}-{{ headerContent }}">
  91.             {% block header_categories_content %}
  92.                 {% sw_include '@Storefront/storefront/layout/header/categories-list.html.twig' with { setting: headerContent } %}
  93.             {% endblock %}
  94.         </div>
  95.     {% endblock %}
  96. {% elseif headerContent == 'settings' %}
  97.     {% block header_settings_wrapper %}
  98.         <div class="header-{{ headerLocation }}-content header-{{ headerLocation }}-{{ headerContent }}">
  99.             {% block header_settings_content %}
  100.                 {% sw_include '@Storefront/storefront/layout/header/actions/settings.html.twig' %}
  101.             {% endblock %}
  102.         </div>
  103.     {% endblock %}
  104.     
  105. {% endif %}