I would like to render a views exposed filter block in my node theme. This is what I am doing:
function MYTHEME_preprocess_node(&$vars) {
$search_form = drupal_get_form('views_exposed_form');
$search_box = drupal_render($search_form);
$vars['search_box'] = $search_box;
}
This way I could simply add variable $search_box into my theme and the filter block would be displayed.
I have confirmed and 'views_exposed_form' is the correct form_id. The problem is that this is throwing a nasty error that doesn't log the error message. My template gets broken (still appears, but broken) and no error message is logged.
It does work if I try to display, let's say, a regular search box. The code is the same, all I have to do is change to the search block form id (search_form) like this:
$search_form = drupal_get_form('search_form');
Right now, I am almost pulling my hair, have searched up and down the web. Any help is appreciated. Thank you!