custom/plugins/TcinnThemeWareModern/src/Resources/views/storefront/section/cms-section-sidebar.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/section/cms-section-sidebar.html.twig' %}
  2. {# TODO: prüfen... #}
  3. {# ---------------- START: SET TEMPLATE VARS ---------------- #}
  4. {# ThemeWare: Set theme variables #}
  5. {% set twtSidebarContentSticky = theme_config('twt-sidebar-content-sticky') %}
  6. {% set twtSidebarElement1 = theme_config('twt-sidebar-element-1') %}
  7. {% set twtSidebarElement1Toggle = theme_config('twt-sidebar-element-1-toggle') %}
  8. {% set twtSidebarElement1Position = theme_config('twt-sidebar-element-1-position') %}
  9. {% set twtSidebarElement2 = theme_config('twt-sidebar-element-2') %}
  10. {% set twtSidebarElement2Toggle = theme_config('twt-sidebar-element-2-toggle') %}
  11. {% set twtSidebarElement2Position = theme_config('twt-sidebar-element-2-position') %}
  12. {% set twtSidebarElement3 = theme_config('twt-sidebar-element-3') %}
  13. {% set twtSidebarElement3Toggle = theme_config('twt-sidebar-element-3-toggle') %}
  14. {% set twtSidebarElement3Position = theme_config('twt-sidebar-element-3-position') %}
  15. {# ---------------- END: SET TEMPLATE VARS ---------------- #}
  16. {# TODO: Change display with class instaed with CSS #}
  17. {# TODO: Move twt content to seperate twig file... #}
  18. {# TODO: HC-Architecture..! #}
  19. {% block section_sidebar_content %}
  20.     {# ThemeWare: Create Sidebar-Elements #}
  21.     {% set twtSidebarElements = {} %}
  22.     {# ThemeWare: Sidebar-Element 1 #}
  23.     {% if twtSidebarElement1 != 'none' %}
  24.         {% set twtSidebarElements = twtSidebarElements|merge({
  25.             1: {
  26.                 elementid: 1,
  27.                 element: twtSidebarElement1,
  28.                 toggle: twtSidebarElement1Toggle,
  29.                 position: twtSidebarElement1Position
  30.             }
  31.         }) %}
  32.     {% endif %}
  33.     {# ThemeWare: Sidebar-Element 2 #}
  34.     {% if twtSidebarElement2 != 'none' %}
  35.         {% set twtSidebarElements = twtSidebarElements|merge({
  36.             2: {
  37.                 elementid: 2,
  38.                 element: twtSidebarElement2,
  39.                 toggle: twtSidebarElement2Toggle,
  40.                 position: twtSidebarElement2Position
  41.             }
  42.         }) %}
  43.     {% endif %}
  44.     {# ThemeWare: Sidebar-Element 3 #}
  45.     {% if twtSidebarElement3 != 'none' %}
  46.         {% set twtSidebarElements = twtSidebarElements|merge({
  47.             3: {
  48.                 elementid: 3,
  49.                 element: twtSidebarElement3,
  50.                 toggle: twtSidebarElement3Toggle,
  51.                 position: twtSidebarElement3Position
  52.             }
  53.         }) %}
  54.     {% endif %}
  55.     <div class="cms-section-sidebar-sidebar-content col-lg-4 col-xl-3">
  56.         {% if twtSidebarContentSticky == "2" %}<div class="twt-sidebar-content-container">{% endif %}
  57.         {# ThemeWare: Add ThemeWare upper section #}
  58.         {% block twt_section_sidebar_block_top %}
  59.             {% set counterTop = 0 %}
  60.             {% for resultTop in twtSidebarElements %}
  61.                 {% if resultTop.position == "2" %}
  62.                     {% set counterTop = ( counterTop | default(0) ) + 1 %}
  63.                 {% endif %}
  64.             {% endfor %}
  65.             {% if counterTop >= 1 %}
  66.                 <div class="twt-block twt-block-sidebar-top">
  67.                     {% for sidebarValueTop in twtSidebarElements %}
  68.                         {% if sidebarValueTop.position == "2" %}
  69.                             {# sw_include '@Storefront/storefront/themeware/sidebar-elements/twt-' ~ sidebarValueTop.element ~ '.html.twig' ignore missing #}
  70.                             {% sw_include '@Storefront/storefront/themeware/twt-sidebar-widgets.html.twig' ignore missing with {
  71.                                 element:sidebarValueTop.element,
  72.                                 toggle:sidebarValueTop.toggle,
  73.                                 elementid:sidebarValueTop.elementid
  74.                             } %}
  75.                         {% endif %}
  76.                     {% endfor %}
  77.                 </div>
  78.             {% endif %}
  79.         {% endblock %}
  80.         {# Default sidebar #}
  81.         {% for block in sidebarBlocks %}
  82.             {% block section_sidebar_content_block %}
  83.                 {% sw_include "@Storefront/storefront/section/cms-section-block-container.html.twig" %}
  84.             {% endblock %}
  85.         {% endfor %}
  86.         {# ThemeWare: Add ThemeWare lower section #}
  87.         {% block twt_section_sidebar_block_bottom %}
  88.             {% set counterBottom = 0 %}
  89.             {% for resultBottom in twtSidebarElements %}
  90.                 {% if resultBottom.position == "3" %}
  91.                     {% set counterBottom = ( counterBottom | default(0) ) + 1 %}
  92.                 {% endif %}
  93.             {% endfor %}
  94.             {% if counterBottom >= 1 %}
  95.                 <div class="twt-block twt-block-sidebar-bottom">
  96.                     {% for sidebarValueBottom in twtSidebarElements %}
  97.                         {% if sidebarValueBottom.position == "3" %}
  98.                             {# sw_include '@Storefront/storefront/themeware/sidebar-elements/twt-' ~ sidebarValueBottom.element ~ '.html.twig' ignore missing #}
  99.                             {% sw_include '@Storefront/storefront/themeware/twt-sidebar-widgets.html.twig' ignore missing with {
  100.                                 element:sidebarValueBottom.element,
  101.                                 toggle:sidebarValueBottom.toggle,
  102.                                 elementid:sidebarValueBottom.elementid
  103.                             } %}
  104.                         {% endif %}
  105.                     {% endfor %}
  106.                 </div>
  107.             {% endif %}
  108.         {% endblock %}
  109.     {% if twtSidebarContentSticky == "2" %}</div>{% endif %}
  110.     </div>
  111. {% endblock %}