templates/includes/product-sorting.html.twig line 1

Open in your IDE?
  1. <div class="col-12 col-sm-auto">
  2.     <select name="products-view" id="products-view" class="form-select">
  3.         <option value="list">Toon als lijst</option>
  4.         <option value="thumblist" {{ view == 'thumblist' ? 'selected' : '' }}>Toon als thumbnail lijst</option>
  5.         <option value="thumb" {{ view == 'thumb' ? 'selected' : '' }}>Toon als thumbnails</option>
  6.     </select>
  7. </div>
  8. <div class="col-12 col-sm-auto">
  9.     <select name="products-sort" id="products-sort" class="form-select">
  10.         <option value="`group`">Sorteer op productgroep</option>
  11.         <option value="code" {{ app.request.get('sort') == 'code' ? 'selected' : '' }}>Sorteer op zoekcode</option>
  12.         <option value="title" {{ app.request.get('sort') == 'title' ? 'selected' : '' }}>Sorteer op omschrijving</option>
  13.         <option value="brand" {{ app.request.get('sort') == 'brand' ? 'selected' : '' }}>Sorteer op merk</option>
  14.     </select>
  15. </div>
  16. {% if paginationVariables is defined %}
  17.     <div class="col-12 col-sm-auto">
  18.         <select name="products-perpage" id="products-perpage" class="form-select">
  19.             {% set startValue = 25 %}
  20.             {% set multiplier =  2 %}
  21.             {% for i in 0..4 %}
  22.                 {% set value = startValue * (multiplier ** i) %}
  23.                 {% if productsPerPage %}
  24.                     {% set selected = productsPerPage == value %}
  25.                 {% else %}
  26.                     {% set selected = app.request.get('perpage') == value %}
  27.                 {% endif %}
  28.                 <option value="{{ value }}" {{ selected ? 'selected' : ''  }}>{{'Toon aantal'|trans }} ({{ value }})</option>
  29.             {% endfor %}
  30.         </select>
  31.     </div>
  32. {% endif %}