custom/plugins/ArboroProductListingLayout/src/Resources/views/plugin/component/product/layout.html.twig line 1

Open in your IDE?
  1. {#
  2. # Project:      www.betten-abc.de
  3. # Company:      arboro GmbH
  4. # Created by:   Daniel Geike
  5. # Created on:   27.04.22
  6. # Description:
  7. #}
  8. {% block element_product_listing_view %}
  9.     {% set cmsPage = page.cmsPage %}
  10.     {% if config("ArboroProductListingLayout.config.showOnListingPage") or (page.searchTerm and config("ArboroProductListingLayout.config.showOnSearchResults")) %}
  11.         {% if views is empty %}
  12.             {% set views = {
  13.                 grid: {
  14.                     content: "layout.grid.label"|trans
  15.                 },
  16.                 list: {
  17.                     content: "layout.list.label"|trans
  18.                 }
  19.             } %}
  20.         {% endif %}
  21.         <div class="listing-actions-view" data-listing-layout="true">
  22.             {% for key, view in views %}
  23.                 {% block element_product_listing_view_loop %}
  24.                     {# concatenate strings to add dynamic translation #}
  25.                     {% set title =  "layout" ~ "." ~ key ~ "." ~ "title" %}
  26.                     {% block element_product_listing_view_button %}
  27.                         <button class="btn btn-outline listing-layout-btn{% if config("ArboroProductListingLayout.config.defaultLayout") is same as key %} active{% endif %}"
  28.                                 type="button"
  29.                                 data-listing-layout-button="true"
  30.                                 data-layout="{{ key }}"
  31.                                 title="{{ title|trans }}"
  32.                         >
  33.                             {{ view.content }}
  34.                         </button>
  35.                     {% endblock %}
  36.                 {% endblock %}
  37.             {% endfor %}
  38.         </div>
  39.     {% endif %}
  40. {% endblock %}