{%- liquid assign has_filters = false if search.filters != empty and section.settings.show_filters assign has_filters = true endif assign types = search.types | join: ',' | url_encode assign types = 'type=' | append: types assign accordion_initial_state = 'accordion-is-open' assign accordion_open_boolean = true if section.settings.collapse_filters # no class means the accordion is closed assign accordion_initial_state = '' # accordion_open_boolean is used to set aria-expanded and # match js logic for 'display: none' on accordion body elements # which are non-adjacent siblings that cannot easily be styled with CSS assign accordion_open_boolean = false endif -%} {% schema %} { "name": "Search", "settings": [ { "type": "header", "content": "Search" }, { "type": "checkbox", "id": "show_filters", "default": true, "label": "Show product filters" }, { "type": "checkbox", "id": "collapse_filters", "label": "Collapse filter accordions", "info": "Active filters will remain open", "default": false }, { "type": "checkbox", "id": "show_products_count", "label": "Show products count", "info": "Product count will be shown when filters are active", "default": true }, { "type": "range", "id": "pagination_count", "min": 3, "max": 50, "step": 1, "label": "Results per page", "default": 24 }, { "type": "header", "content": "Section spacing" }, { "type": "select", "id": "width", "label": "Width", "default": "wrapper", "options": [ { "value": "wrapper--full", "label": "Full width padded" }, { "value": "wrapper", "label": "Page width" }, { "value": "wrapper--narrow", "label": "Page width narrow" }, { "value": "wrapper--tiny", "label": "Page width extra narrow" } ] }, { "type": "range", "id": "padding_top", "min": 0, "max": 180, "step": 2, "unit": "px", "label": "Padding top", "default": 36 }, { "type": "range", "id": "padding_bottom", "min": 0, "max": 180, "step": 2, "unit": "px", "label": "Padding bottom", "default": 36 } ] } {% endschema %}