Hi,
I am trying to break my views into two parts the exposed from as a block which is going to be at the top portion of the site. The results will be at the bottom right portion of the block.

I have created a layout for better explanation http://imagebin.org/154224

Cheers,
Vishal

CommentFileSizeAuthor
#2 layout.png45.67 KBvishalkhialani

Comments

grndlvl’s picture

I am not quite following and the image you linked had been removed. Could you upload again? Probably best to upload to ticket that way it does not get removed so quickly.

vishalkhialani’s picture

StatusFileSize
new45.67 KB

Hi,
Here you go.

As you can see the layout is such that the exposed form will be at the top banner and I want the results to be shown via ajax on the bottom of the screen.

I have been trying to get this done for quiet some time.

Cheers,
Vishal

grndlvl’s picture

I have now added code that will support the exposed form block just as in the page display. I have also added support for manually embedding the exposed form manually.

These changes are available in the 7.x-2.x branch currently.

I need to update some advanced_help code and provide some code examples for using the embed exposed form utility.

Once I update the documentation etc... I will release the module into beta.

grndlvl’s picture

Assigned: Unassigned » grndlvl
grndlvl’s picture

Status: Closed (fixed) » Active

Documentation

/**
 * Returns the exposed filter widgets for a view.
 *
 * @param mixed $view
 *  Either a string with the name of the view or an object of the view
 * @param string $display_id
 *  An optional string with the name of the display for the view.
 *
 * @return string
 *  The themed exposed filter form.
 */
function embed_views_exposed_form($view, $display_id = '') {

To figure out the id of a display, look under Other, in the
view edit page for the particular view that will be embedded, for
Machine Name what ever this name is is what should be used
for the $display_id variable.

Usage

Simple version of code to embed an exposed filter.

  print embed_views_exposed_form('test', 'embed_1');

Embedding a view's exposed form for an alrady created view using the
embed_views_exposed_form() helper function.

  $view = views_get_view('test');
  $view->set_display('embed_1');
  print embed_views_exposed_form($view);

  ... some other code ...

  $view->destroy();

Embedding a view's exposed form for an already created view using the
display's embed_views_exposed_form() helper method.

  $view = views_get_view('test');
  $view->set_display('embed_1');
  print $view->display_handler->embed_views_exposed_form();

  ... some other code ...

  $view->destroy();
grndlvl’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

topdawg’s picture

I'm getting this error:

Fatal error: Call to undefined function embed_views_exposed_form() in C:\apache\xampp\htdocs\nickray\modules\php\php.module(74) : eval()'d code on line 2

grndlvl’s picture

Which version of embed_views_display?

topdawg’s picture

Thank you -- embed_views-7.x-1.1

grndlvl’s picture

Ok then that's the issue if you want the embed_views_exposed_form functionality you need to update to the 7.x-2.0-beta1

nicolas bouteille’s picture

Status: Active » Closed (fixed)

Awesome thanks!