1

I want to show 'Items per page' bellow the pager, I found viewsxtras, but it's just a placeholder and does not contain any code.

I'm using drupal 7 and views 3.x. How can I do this?

3 Answers 3

2

enter image description here

In Drupal 7 under PAGER click on "Paged, xx items", then look at the Pager options window

0

I think you can make use of the count in the aggrevation and then display it custom text in the footer region in the views. I have done it once, but not sure how.

0

This will only work with views exposed form

In .module file -> hook_form_alter

$pager_options = array(5, 10, 15, 20, 25);
$form['your-views-form-id'] = array(
  ‘#type’ => ‘select’,
  ‘#options’ => $pager_options,
  ‘#default_value’ => 0,
  ‘#title’ => t(‘Items per page’),
);


$pages = $pager_options[$form_state['input']['your-views-form-id']];
$form_state['view']->set_items_per_page($pages);

It will provide you a select box with the options you have given and you will be able select no. of items to display on result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.