4

I would like to ask how can I create 2 or more exposed filter for the same view,which can be placed in different places of a site. E.g. one exposed filter will have 3 fields,the second one will have 7 fields. thanks

4 Answers 4

4

One way is that you can expose the fitler block by configuring (EXPOSED FORM option in views) the "Exposed form in block" to "Yes" for as I have done below:

enter image description here

This way you will have the exposed filter available as a block at "/admin/structure/block".

Now as you want to create expose filter with 3 fields and 7 fields for the same view so than you do the following for that:

  • Create view of block type and add the required fields (if you want it to be of fields type).
  • Add the fields in "FILTER CRITERIA" section and this will be your expose filter fields. (Right now add the 3 fields).
  • Add another block for the same view, and now the view be same and you have all the fields available you have added in the previous block.
  • In the new block, add only new expose filter fields (just make sure you select "This page (Override)" while adding the fields for second block.

Hope this will work as you want.

8
  • Hi and thanks for the answer.I don't think this will work,because which view of the 2 I will add to the page?These are 2 different views with different exposed filters.
    – Dion
    Commented Oct 1, 2013 at 12:30
  • @sokratis I didn't get you ("which view of the 2 I will add to the page"). you can create two pages in the same view that will contains the same display fields & the different expose filter fields. Can you once try please, if possible Commented Oct 1, 2013 at 12:37
  • I see what you mean.Isn't it possible to create one page,which will contain the view, and two exposed filters that will query this view?
    – Dion
    Commented Oct 1, 2013 at 12:38
  • That also you can do, than you to choose display type as block instead of the page, and than you can display both the block on same page as well (and not to forget, the exposed filter blocks too) :) Commented Oct 1, 2013 at 12:46
  • @sokratis I am pretty much sure that this is doable, let me know if you facing any issue with it. Commented Oct 1, 2013 at 13:02
4

I finally found how to do this: I first create the view with the first exposed filter. Then I clone the view and change the fields of the exposed filter,so as I have a second exposed filter.

Then I can place the first view in which page I want and same thing for the first and second exposed filter.Then I just redirect the exposed filters to the page where the first view exists . (The second view is placed nowhere,it is just used to give us the second exposed filter).

Finally,when I submist an exposed filter,they redirect to the page where the view leaves and the view is filtered from the URL parameters that the exposed filters are sending. I hope this make sense :)

1

When you say "placed in different places of a site" I am assuming you mean "different places on the page".

The Better Exposed Filter module will get you part of the way there. This module will allow you to assign your exposed filters to a block and display them on some other part of the page. This module will also allow you to define certain filters as "secondary filters", which will appear only after the primary filters have been used.

However, all of the filters have to be in the same place; either in a block, or with the results themselves.

1
  • :Hello for the answer.Actually when I mean to different places,I meant to different places of the site i.e. different panel pages.
    – Dion
    Commented Sep 30, 2013 at 21:22
0

The MEFIBS - More exposed forms in blocks allows exposed filters to be split up into different blocks. Combined with panels, context, or core block visibility settings you could have a different set on each page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.