custom/plugins/TcinnThemeWareClean/src/Resources/views/storefront/themeware/extensions/twt-usp-bar.html.twig line 1

Open in your IDE?
  1. {# ThemeWare "USP bar" (Extension container) #}
  2. {#
  3.     Create container and include the USPs
  4.     type: header/footer
  5.     @Storefront/storefront/themeware/extensions/twt-usp-bar.html.twig
  6. #}
  7. {# TODO: Blöcke prüfen... #}
  8. {# ---------------- START: SET TEMPLATE VARS ---------------- #}
  9. {# ThemeWare: Set theme variables #}
  10. {% set twtUspBarHeaderLayout = theme_config('twt-usp-bar-header-layout') %}
  11. {% set twtUspBarFooterLayout = theme_config('twt-usp-bar-footer-layout') %}
  12. {% set twtUspBarWidgetContent = theme_config('twt-usp-bar-widget-content') %}
  13. {% set twtUspBarBreakpointItem1 = theme_config('twt-usp-bar-breakpoint-item-1') %}
  14. {% set twtUspBarBreakpointItem2 = theme_config('twt-usp-bar-breakpoint-item-2') %}
  15. {% set twtUspBarBreakpointItem3 = theme_config('twt-usp-bar-breakpoint-item-3') %}
  16. {% set twtUspBarBreakpointItem4 = theme_config('twt-usp-bar-breakpoint-item-4') %}
  17. {% set twtUspBarBreakpointItem5 = theme_config('twt-usp-bar-breakpoint-item-5') %}
  18. {% set twtUspBarBreakpointItem6 = theme_config('twt-usp-bar-breakpoint-item-6') %}
  19. {# ThemeWare: Set layout and style for use in css classes #}
  20. {% set style = 0 %}
  21. {% set layout = 0 %}
  22. {# Header #}
  23. {% if type == "header" %}
  24.     {% if twtUspBarHeaderLayout == "1" %} {# Small icons #}
  25.         {% set style = "small" %}
  26.         {% set layout = "1" %}
  27.     {% endif %}
  28.     {% if twtUspBarHeaderLayout == "2" %} {# Small icons + Top bar #}
  29.         {% set style = "small" %}
  30.         {% set layout = "2" %}
  31.     {% endif %}
  32.     {% if twtUspBarHeaderLayout == "3" %} {# Small icons + Widget #}
  33.         {% set style = "small" %}
  34.         {% set layout = "3" %}
  35.     {% endif %}
  36. {% endif %}
  37. {# Footer #}
  38. {% if type == "footer" %}
  39.     {% if twtUspBarFooterLayout == "1" %} {# Small icons #}
  40.         {% set style = "small" %}
  41.         {% set layout = "1" %}
  42.     {% endif %}
  43.     {% if twtUspBarFooterLayout == "2" %} {# Large icons #}
  44.         {% set style = "large" %}
  45.         {% set layout = "2" %}
  46.     {% endif %}
  47.     {% if twtUspBarFooterLayout == "3" %} {# Large icons with subtitles #}
  48.         {% set style = "large" %}
  49.         {% set layout = "3" %}
  50.     {% endif %}
  51. {% endif %}
  52. {# ThemeWare: Count visible USPs #}
  53. {% set items = 0 %}
  54. {# USP bar item 1 #}
  55. {% if twtUspBarBreakpointItem1 > 1 %}
  56.     {% set items = items + 1 %}
  57. {% endif %}
  58. {# USP bar item 2 #}
  59. {% if twtUspBarBreakpointItem2 > 1 %}
  60.     {% set items = items + 1 %}
  61. {% endif %}
  62. {# USP bar item 3 #}
  63. {% if twtUspBarBreakpointItem3 > 1 %}
  64.     {% set items = items + 1 %}
  65. {% endif %}
  66. {# USP bar item 4 #}
  67. {% if twtUspBarBreakpointItem4 > 1 %}
  68.     {% set items = items + 1 %}
  69. {% endif %}
  70. {# USP bar item 5 #}
  71. {% if twtUspBarBreakpointItem5 > 1 %}
  72.     {% set items = items + 1 %}
  73. {% endif %}
  74. {# USP bar item 6 #}
  75. {% if twtUspBarBreakpointItem6 > 1 %}
  76.     {% set items = items + 1 %}
  77. {% endif %}
  78. {# ---------------- END: SET TEMPLATE VARS ---------------- #}
  79. {% block twt_usp_bar %}
  80.     {# ThemeWare: USP in Header and Footer   #customHeader #}
  81.     <section class="twt-usp-bar is-{% if type %}{{ type }}{% endif %} is-{{ style }} layout-{{ layout }}{% if alignment %} {{ alignment }}{% endif %}{% if twtUspBarHeaderLayout != 1 and type == "header" %} has-widget{% endif %}" data-twt-usps="{{ items }}">
  82.         {% block twt_usp_bar_container %}
  83.             <div class="twt-usp-bar-container">
  84.                 <div class="twt-usp-bar-items{% if twtUspBarHeaderLayout != 1 and type == "header" %} col{% endif %}">
  85.                     {% sw_include '@Storefront/storefront/themeware/includes/twt-usp-bar-include.html.twig' ignore missing with {
  86.                         type: type
  87.                     } %}
  88.                 </div>
  89.                 {# ThemeWare: Add Top bar to usp bar when usp bar layout (twt-usp-bar-header-layout) is "USP bar + Top bar" (2) #}
  90.                 {# TODO: Check if a parameter should be used in the top-bar.html.twig #}
  91.                 {% if twtUspBarHeaderLayout == 2 and type == "header" %}
  92.                     <div class="twt-widget is-top-bar col-auto d-none d-lg-flex">
  93.                         {% sw_include '@Storefront/storefront/layout/header/top-bar.html.twig' %}
  94.                     </div>
  95.                 {% endif %}
  96.                 {# ThemeWare: Add widget to USP bar when usp bar layout (twt-usp-bar-header-layout) is "USP bar + Widget" (3) #}
  97.                 {% if twtUspBarHeaderLayout == 3 and type == "header" %}
  98.                     <div class="twt-widget is-widget col-auto d-none d-lg-flex">
  99.                         {% if twtUspBarWidgetContent == "communities" %}
  100.                             {% sw_include '@Storefront/storefront/themeware/widgets/twt-communities-include.html.twig' ignore missing with {
  101.                                 type: 'usp-bar'
  102.                             } %}
  103.                         {% endif %}
  104.                     </div>
  105.                 {% endif %}
  106.             </div>
  107.         {% endblock %}
  108.     </section>
  109. {% endblock %}