4

I know in views you have the option to expose the filters form as a block, but doing so removes the exposed form from the view page. Is there any way to expose the filters form as a block and keep the exposed form in the view as well?

For example, is there a way to see
Views exposed form
at the top of my view, but on every other page have an exposed form block like
enter image description here
in the side bar?

This would be helpful as when a user is on a view page, he/she will be primarily concentrating on the main content and would look for a search there (instead of in a block on the side of the page). However, users should be able to search the view from any page on the site (enter block).

Currently I have a custom module creating a block to act as the exposed form block while in Views I have Expose form in block set to "No". Is there an easier way to handle this?

1 Answer 1

3

This hack works very well but there's no need for a hack if you have seperate displays from your view. My search results were displayed as a "Page" display and you also have the "Default" display.

On the page you would click "Exposed form in a block" then click "Override" on the right hand side. Set this to "No" (so the form now displays on the search page). In the "Default" display, have "Exposed form in a block" set to "Yes" - so by default it produces a block, but you also get the form to appear on the search page as well.

Thanks guys, Garry.

4
  • clever :) this seems to be a better approach. hacks are last resorts.
    – jwal
    Commented May 20, 2011 at 17:13
  • I don't think this works with Views 3. You can't override the the 'exposed in a block' setting per display, neither can you access the default display directly. Commented Nov 28, 2011 at 12:14
  • That's correct. This doesn't work for D7, Views 3. -1
    – Fidelix
    Commented Feb 17, 2012 at 15:46
  • @Fidelix the question was geared towards D6. During a tag migration all questions accidentally got the "7" tag.
    – Laxman13
    Commented Mar 12, 2012 at 14:31

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.