Skip to main content
2 of 2
added 434 characters in body
lorenzo
  • 297
  • 3
  • 13

Drupal 7 - Exposed form block also inside results

In Drupal 7 I created a view with an exposed form in a block. The view has a "page" display.

Users can make their searches using the exposed form in the pages where I placed the block.

I would like to put the filter also in the results page, but it is placed always after the results, while I would like to have that between the page title and the results.

Example:

what happens

PAGE TITLE

VIEWS RESULTS

EXPOSED FORM

what I would like to do

PAGE TITLE

EXPOSED FORM

VIEWS RESULTS

Any idea? thank you in advance


As I write below, I found the solution:

I had to:

  1. Create the view

  2. Expose the form

  3. Add a "Global PHP" in the view header with the following code:

    $block = block_load('views', '-exp-myview-page'); $output = drupal_render(_block_get_renderable_array(_block_render_blocks(array($block)))); print $output;

Surely it can be done also using template instead of the php in the header.

lorenzo
  • 297
  • 3
  • 13