{#
# Project: www.betten-abc.de
# Company: arboro GmbH
# Created by: Daniel Geike
# Created on: 27.04.22
# Description:
#}
{% block element_product_listing_view %}
{% set cmsPage = page.cmsPage %}
{% if config("ArboroProductListingLayout.config.showOnListingPage") or (page.searchTerm and config("ArboroProductListingLayout.config.showOnSearchResults")) %}
{% if views is empty %}
{% set views = {
grid: {
content: "layout.grid.label"|trans
},
list: {
content: "layout.list.label"|trans
}
} %}
{% endif %}
<div class="listing-actions-view" data-listing-layout="true">
{% for key, view in views %}
{% block element_product_listing_view_loop %}
{# concatenate strings to add dynamic translation #}
{% set title = "layout" ~ "." ~ key ~ "." ~ "title" %}
{% block element_product_listing_view_button %}
<button class="btn btn-outline listing-layout-btn{% if config("ArboroProductListingLayout.config.defaultLayout") is same as key %} active{% endif %}"
type="button"
data-listing-layout-button="true"
data-layout="{{ key }}"
title="{{ title|trans }}"
>
{{ view.content }}
</button>
{% endblock %}
{% endblock %}
{% endfor %}
</div>
{% endif %}
{% endblock %}