I have created a page using Views and it works fine. I want to add an AJAX filter to this page to allow visitors to filter the contents based on PubDate or by Taxonomy/Vocabulary for this content type. How can I accomplish this?

  • Hello Lina, and welcome to Drupal Answers. For which Drupal version is your question? – kiamlaluno Apr 17 '11 at 12:03
  • it is for drupal 6.19 – Lina Apr 17 '11 at 13:28
  1. Edit the view, and add a filter to the page:

    • Drupal 6: Third column, section is called Filters
    • Drupal 7: First column, section is called Filter Criteria
  2. When you configure the filter, you want to expose it:

    • Drupal 6: Click the Expose button in the top right of the configure area
    • Drupal 7: Check Expose this filter to visitors, to allow them to change it
  3. Enable AJAX:

    • Drupal 6: Use AJAX is under Basic settings in the first column
    • Drupal 7: Use AJAX is under AdvancedOther in the third column

When the view is saved, there will now be a form that'll allow users to filter the view dynamically via AJAX.

  • 2
    Thanks a lot, but do you have any idea of how to customize the user input (for example: to show list of labels and the user get response by clicking one of those labels) thanks again – Lina Apr 17 '11 at 13:26

Maybe, you can use the Better exposed filters module to change output of your filter items to links.

And Use AJAX option in Advanced settings of a view to make filtering ajaxifyed.


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.