Hi,

I wonder how to get sort criteria located and selected in ajax tabs of a view on Drupal 7 with Views 3?
Imagine a list of news, sorted by date (Newest). But we need also to sort them by number of voices (Best), and maybe - by count of comments (Popular) - just in place, via ajax, by clicking corresponding Tabs: Newest, Best, Popular. How to do this?
Example: http://www.onlinedisk.ru/view/607546

Comments

jamsilver’s picture

A way I have done this before is with http://drupal.org/project/quicktabs. This is a module that allows you to create a block which has multiple tabbed pages each of which can be configured to contain something else (another block, a view, another quicktabs block...).

With this approach you could create multiple displays on your view - one for each kind of sort you are interested in. Then you could create a quicktabs block - one page for each display. Quicktabs should allow switching between these pages using ajax.

Only caveat with this approach is that it looks like quicktabs may not have a good Drupal 7 release - it only seems to have a dev branch for d7. Not sure how long it will take for that to change. Might be worth checking out the issue queue for it and gauging how stable that dev snapshot is..?

OnkelTem’s picture

Thank you very much, I will give it a try.

Regarding multiple displays for every sort criteria - this seems to be overwork, since configuring a specific display is time consuming itself, then repeating configuration for every display... then maintaining all of them - is not optimal.

I'm going to try using arguments and their handling code to get sorting.