Exposed Filters on Block Views

Exposed filters in Views are a wonderful thing. They allow your site visitors the ability to dynamically alter a view to suit their needs best. But what happens when you display your view in a block?

Exposed filters on View pages use URL querystring variables to pass the filter variables back to the server, but when your view is displayed in a block, this isn't possible.

Luckily, with Views 2, there's a supereasy work-around. Simply set the "Use AJAX" option to "Yes" in your view's "Basic settings" and your exposed filters will magically appear in your View blocks. Instead of utilizing the URL querystring to pass exposed filter variables around, the "Use AJAX" option does everything behind the scene and not touching the URL.

Comments

AJAX isn't working on block views, it just brings you back to the homepage. How do you get around that ?

Submitted by Guest (not verified) on Tue, 03/09/2010 - 04:47

Turn off "Exposed form in block". The form will appear in the same block rather than a separate one, and then it will work correctly.

Submitted by Guest (not verified) on Wed, 05/19/2010 - 16:20

Ahhhh! Why is this not in Views docs/inline help? Just wasted a bunch of time trying to figure out why my filters were not working for blocks!

Thanks for the tip!

Yuriy / yuriybabenko.com

Submitted by Guest (not verified) on Thu, 07/14/2011 - 17:58

with ajax enable, its work for me for block view.

Submitted by Guest (not verified) on Tue, 07/03/2012 - 06:56

Sign up to receive email notifications of whenever we publish a new blog post or quicktip!

Name