2
votes

Need help again guys, Is there any way to display the exposed filters in a block and in a page without delete the filters of the page? I am using Exposed Form Filter at YES, the block with the filters is created but when i go to the page of the view, i cannot see the exposed filter.

i have for example page.tpl with the exposed block on it. But in templates/custom-page.tpl (where are the original exposed filters) cannot see them after enable Exposed Form Filter. What i want is that the exposed filters show up in both page and block.

I googled it but i couldn't find the solution yet. I would be gratefull if you can help me. Thanks!!! I am using Drupal 7.

2
Maybe a stupid question, but did you added your filter block to some region? You have to add it as any other block or it won't be visible on front-end.MilanG
Yes, i will post below how i solved it, so i will be helpful for anyone.HomerO

2 Answers

2
votes

It's actually your idea, but I'll add it for others:

  1. Edit your view.
  2. Clone the "Page" in view.
  3. Rename the page something like "SearchBlock" (also change machine name to "search_block").
  4. Enable "Exposed form in block".
  5. Open blocks configuration (#overlay=admin/structure/block).
  6. Your new block will be somewhere on the button named something like: "Exposed form: your_view-search_block".

Point 3 is of course not required, but it will make things more obvious. And you usually need things to be obvious 6 months after you did something ;-).

BTW. You can remove filters from the block after you've cloned the page. There are only two requirements:

  1. Filters on the page and in the block must have the same machine name and operator settings.
  2. Block and filter must point to the same URL.

This also means you can add more blocks with various sets of filters.

1
votes

You could set the exposed form not to be in a block (so it appears on the page). Then you could make your own block which has the exposed form in it (using the views functions to get the exposed form).
To get the exposed form check these links.
Drupal 7 Views 3: How to programmatically embed a Views exposed filter

OR.

You could expose the filters in a block, put this block on the views page and then use multiblock to make another copy of the exposed filter block to put somewhere else. This is probably easier.