5

Hi there drupal wizards.

I want to be able to filter two different view displays and display the search results of a filter query simultaneously on the same page with only one shared filter criteria search that works on both views.

I have no problem to do the filter criteria for each one, but I want one common filter search criteria that filters both views and displays them one after the other on the same page.

How do I do this?

If possible I don't want to hack code, just configure things.

To be more precise: I have one map search working based on location data. The filter is exposed as a block. However I've created a block display showing the same view as a table list that the filter block query does not seem to affect at all. I'm using context to display the second view display block In the same path.

3

Seems like you want to display two different views with a common shared exposed filter in the same page (or as you said "same path"), instead of making two displays of the same view:

  1. After created your view and your primary "view block", add the needed filter to that block, make sure that the filter is valid for all pages.
  2. Then create an Attachment (you can find it in view configuration page Add>Attachment), and attach its to the block in Attachment settings by chosing "Attach to:Block" and set a preferred display position of that attachment (Attachment position)
  3. Configure your Attachment with your needed format and fields, making sure that these configurations are for "this Attachment only"(*override)
  4. Finally Set to Yes the "Inherit exposed filters:" in Attachment settings
  5. Et voilà enjoy your block+attachment with the same shared filter!

If you want to share the same filter in more than one views globally in the entire site, you can take a look to modules like Views Global Filter

2

This might work :) If you have two views, which both have the same field exposed as a filter, you could set the Filter identifier to the same value. Go to the filter on both views and under More you will find "Filter identifier", set it to the same value.

  • Thanks. Didn't work exactly though. However I've now taken this route for finding a solution by using two drupal views. The problem is just to make the two views share the same exposed filter block but on different pages, as the exposed block is situated in the place of the menu sub-links. (I want to find a solution that replaces the id of the block when I switch page so I can have the different search in the same place on the page as on the other page. My new question is here: drupal.stackexchange.com/questions/40283/… – Math Aug 20 '12 at 14:08

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.