Skip to content

Instantly share code, notes, and snippets.

@steffenr
Created March 24, 2011 19:37
Show Gist options
  • Save steffenr/885699 to your computer and use it in GitHub Desktop.
Save steffenr/885699 to your computer and use it in GitHub Desktop.
hook_form_alter to add items per page to exposed filter
<?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