- Issue created by @nitesh624
This has steps to reproduce like a bug report but it is a support request.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
You are putting the select element outside the form tag
The browser won't submit it unless you set the form attribute on the select to the id of the form element
This isn't a Drupal thing, it's how browsers work
- 🇮🇳India nitesh624 Ranchi, India
So i need to do this via hook_preprocess_template right?
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
You will likely need a hook form alter to modify the views exposed form and set the form attribute on the select field
e.g.
function YOURTHEME_form_views_exposed_form_alter(&$form) { $view = $form['#view']; $form['items_per_page']['#attributes']['form'] = $view->id(); }
Something like that
- Status changed to Closed: works as designed
10 months ago 7:48am 11 March 2024 - 🇰🇪Kenya Charles-Kevin-Njuguna
Instead of printing the 'Items per page' as
{{exposed.items_per_page}}
, print it by excluding any other exposed filters such as{{exposed|without('filter_name_one','filter_name_two','filter_name_three')}}
.
This is how I'm doing it:{% if pager %} <div class="col-md-10 ms-md-4"> <div class="row d-flex align-items-center"> <div class="col-md-8"> {{ pager }} </div> {% if exposed %} <div class="col-md-4 d-flex align-items-center view-filters"> <span class="me-md-2">{{'Show'|t}}</span>{{ exposed|without('field_question_right_category_target_id', 'field_state_transition_value') }} </div> {% endif %} </div> </div> {% endif %}