1

I have a content type "news" and a views page to list the news. The views contains a exposed filter (category and year).

How can I realize the select list "Year" with the follwing options as exposed filter:

  • All
  • 2016
  • 2015
  • 2014
  • 2013
  • 2012

When the user selects '2015' the list below is updatet (ajax) and only news entry form 2015 are listed.

How can I realize this?

0
  1. Add filter criteria of Year field.
  2. Now expose this field by selecting 'Expose this filter to visitors, to allow them to change it' option from field setting.
  3. For Ajax behaviour, choose Use AJAX from advance view section.
  • Okay, thank you. There is no field year but a field "date" and the granularity can be set to "year". The question is now how to change the order of the select list entries vom "2010, 2011, 2012 ..." to "2016, 2015, 2014, 2013, ...". Is this possible to change the order of the exposed select list??? Howß – drupalfan Oct 25 '16 at 15:50
  • Use form_alter hook. – Nikhil Banait Oct 27 '16 at 14:23
  • How can I do this? – drupalfan Oct 27 '16 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.