diff --git a/culturefeed_search_ui/culturefeed_search_ui.module b/culturefeed_search_ui/culturefeed_search_ui.module index 00dfdce8..f9f7c631 100644 --- a/culturefeed_search_ui/culturefeed_search_ui.module +++ b/culturefeed_search_ui/culturefeed_search_ui.module @@ -81,11 +81,12 @@ function culturefeed_search_ui_menu() { 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); + $arguments = explode('/', $search_type['path']); $items[$search_type['path'] . '/%'] = array( 'title' => $search_type['page_title'], 'title callback' => FALSE, 'page callback' => 'culturefeed_search_ui_search_page', - 'page arguments' => array($name, $class_name, TRUE), + 'page arguments' => array($name, $class_name, count($arguments)), 'file' => 'includes/pages.inc', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, diff --git a/culturefeed_search_ui/includes/pages.inc b/culturefeed_search_ui/includes/pages.inc index d16d226f..ed64ad31 100644 --- a/culturefeed_search_ui/includes/pages.inc +++ b/culturefeed_search_ui/includes/pages.inc @@ -16,7 +16,7 @@ use \Guzzle\Http\Exception; * @param Boolean $ajax * The type of request. */ -function culturefeed_search_ui_search_page($name, $class_name = NULL, $ajax = FALSE) { +function culturefeed_search_ui_search_page($name, $class_name = NULL, $request_type = 'nojs') { // The first search page callback is a dummy callback to redirect to the // real search page. @@ -28,6 +28,7 @@ function culturefeed_search_ui_search_page($name, $class_name = NULL, $ajax = FA $conf = culturefeed_get_searchable_type($name); $page = culturefeed_get_search_page($conf); + $ajax = $request_type == 'ajax'; if ($ajax) { $page->setFullPage(FALSE); }