Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal show exposed filter both in block and page

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.

like image 228
HomerO Avatar asked Jan 31 '26 15:01

HomerO


1 Answers

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.

like image 58
Nux Avatar answered Feb 03 '26 10:02

Nux



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!