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?

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.

  • clever :) this seems to be a better approach. hacks are last resorts. – jwal May 20 '11 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. – Tom Kirkpatrick Nov 28 '11 at 12:14
  • That's correct. This doesn't work for D7, Views 3. -1 – Fidelix Feb 17 '12 at 15:46
  • @Fidelix the question was geared towards D6. During a tag migration all questions accidentally got the "7" tag. – Laxman13 Mar 12 '12 at 14:31

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.