{% set config = { sorting: current } %}
{% set showSorting = (slot.config.showSorting.value is defined) ? slot.config.showSorting.value : true %}
{% set device = app.session.get('deviceType') %}
{% if showSorting and sortings|length > 1 %}
<div class="d-inline d-lg-inline" data-offcanvas-sorting-content="true">
<div class="sorting sorting-container__data">
<div class="d-inline" data-listing-sorting="true" data-listing-sorting-options='{{ config|json_encode }}'>
<select class="sorting custom-select grm-light" aria-label="{{ 'general.sortingLabel'|trans|striptags }}">
{% if device == 'mobile' or device == 'tablet' %}
<option value="" disabled selected class="d-lg-none">{{ "listing.sort"|trans|sw_sanitize }}</option>
{% endif %}
{% for sorting in sortings %}
{% set key = sorting.key %}
<option value="{{ key }}"{% if key == current and device == 'desktop' %} selected{% endif %}>{{ sorting.translated.label|sw_sanitize }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
{% endif %}