In the HKNA project, i exposed a flag in a view but it turns on the available option names are True and False instead of Yes and No.
Continue reading Drupal 7 – Override the Flag option names in Views Exposed Filter using String Overrides
Tag Archives: Views Exposed Filter
Drupal 7 – Render Views Exposed Filter programmatically
Update at 2015-04-27: Another suggestion by Petu which could render the filter as a block programmatically.
Update at 2014-09-18: An simpler way to do that is to enable the Exposed form in block in the view settings and then render the block as suggested by plano.com.
The following piece of code render the Views Exposed Filter.
$view = views_get_view('<view name>'); $display_id = 'page'; $view->set_display($display_id); $view->init_handlers(); $form_state = array( 'view' => $view, 'display' => $view->display_handler->display, 'exposed_form_plugin' => $view->display_handler->get_plugin('exposed_form'), 'method' => 'get', 'rerender' => TRUE, 'no_redirect' => TRUE, ); $form = drupal_build_form('views_exposed_form', $form_state); print drupal_render($form);
Done =)
Reference: