{% set config = { sorting: current } %}
{% set showSorting = (slot.config.showSorting.value is defined) ? slot.config.showSorting.value : true %}
{% if showSorting and sortings|length > 1 %}
<div class="sorting-wrapper row justify-content-between">
<div class="sorting-pre-label">{{ "lwt.listing.sorting.preLabel"|trans|striptags }}</div>
<div class="sorting" data-listing-sorting="true" data-listing-sorting-options='{{ config|json_encode }}'>
<select class="sorting {{ formSelectClass }}" aria-label="{{ 'general.sortingLabel'|trans|striptags }}">
{% for sorting in sortings %}
{% set key = sorting.key %}
<option value="{{ key }}" {% if key == current %} selected {% endif %}>{{ sorting.translated.label|sw_sanitize }}</option>
{% endfor %}
</select>
{% sw_icon 'arrow-medium-down' style {'pack': 'solid', 'size': 'xs', 'class': 'filter-panel-item-toggle'} %}
</div>
</div>
{% endif %}