Skip to content

Instantly share code, notes, and snippets.

@cmcintosh
Created February 25, 2015 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmcintosh/07a9b14a3d1b2c56f2fa to your computer and use it in GitHub Desktop.
Save cmcintosh/07a9b14a3d1b2c56f2fa to your computer and use it in GitHub Desktop.
/**
* This is search be afeared!
*/
function urbaninstitute_search_menu() {
$item['counter'] = array( );
}
function urbaninstitute_search_menu_counter_callback() {
$query = drupal_get_query_parameters();
$view = views_get_view('view_name');
$view->set_display('view_block_name');
$view->set_arguments(array($tid));
// change the amount of items to show
$view->get_total_rows = TRUE;
$total_items = $view->query->pager->get_total_items();
$results['total'] = $total_items;
$view->set_items_per_page(5);
$view->pre_execute();
$view->execute();
$results['content'] = $view->result();
drupal_render_json();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment