Can Views Filter Block be altered to provide the same filter on differing views?

aireworth - March 29, 2008 - 15:34
Project:Views Filter Block
Version:5.x-1.4
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Can Views Filter Block be altered to provide the same filter on differing views?

I've found this module very useful so far - thank you.

I have several views of differing data that I want to be able to filter by a different (common) vocabulary. e.g. - there are views for diseases, treatments, drug regimes etc- and I want to be able to filter them by species - dog cat cow etc. All the nodes are tagged with both the type of information and by species. I can do this by providing a different block for each view, and only showing it on the page where the view appears - but I've got to nearly 20 different blocks already, and its always the same filter. (I had to alter the module coding to allow for more than 10 blocks).
Can this module be altered to do this, or do I need to continue making blocks, or am I missing something basic about views and filters?

Many thanks

Colin

#1

096754 - February 18, 2009 - 00:50

I have the same question.

#2

MattDrupalee - April 13, 2009 - 07:22

Hello!

I also have the same question.. anyone found an answer on this subject?

Thanks a lot!

Matt

#3

inforeto - June 18, 2009 - 05:18

You can use php in the arguments handler to get the arguments from the node or url path so that you can use the same block in those pages.

#4

MattDrupalee - June 22, 2009 - 20:58

Hi!

I'm not sure it will work so easily: if you define an exposed filter on page 1, when you use it and click on "submit" button, it will put you to the url of page1. So it's not really convenient if you want to use this filter for a page 2 for instance.

Any idea on how to solve this?

Thanks,

Matt

#5

inforeto - June 26, 2009 - 00:52

views filterblock has the url hardcoded on the module as discussed on: http://drupal.org/node/112552
If you still try to modify function views_filterblock($view) it can be done per view name to keep other filterblocks working normal.
Something like:

  if ($view->name == 'nameofview') {
  $form['#action'] = url($somenewurl);
  }

 
 

Drupal is a registered trademark of Dries Buytaert.