Created
March 24, 2011 19:37
-
-
Save steffenr/885699 to your computer and use it in GitHub Desktop.
hook_form_alter to add items per page to exposed filter
This file contains hidden or 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
<?php | |
function mymodule_views_query_alter(&$view, &$query) | |
{ | |
if($view->name=='mitarbeiter') { | |
$itemsPerPage = intval( $view->exposed_input['items_per_page']); // Wert aus dem DropDown auslesen | |
if ($itemsPerPage == 0) { | |
$view->set_items_per_page(10); // Default Limit | |
} | |
else $view->set_items_per_page($itemsPerPage); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment