Created
February 25, 2015 06:23
-
-
Save cmcintosh/07a9b14a3d1b2c56f2fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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