Why does the Views module accep uses the number of items per page that is in pre-defined sets like 5, 10, 25, 50, and doesn't accept values outside those values?

I know how to change it; I just need an explanation.

3 Answers 3


To be brutally simple: Because someone thought it to be good UX, maintainers agreed, and no one convinced them other way since then. That's all to it.

There are many reasons for drop-down instead of text field. For example simplicity. User cannot enter bad values, so there is no need for bad value handling. Testing - you can programatically set other amounts, all right, but there you have ones they tested their module for, and take some responsibility that they work properly. Of course, maybe someone simply liked it that way. No way to know for sure what was the most important part in this decision.


You can do it by using views_pag_views_pre_build()

function views_pag_views_pre_build(&$view) {
    if ($view->name == "pagination") {


Reference Human Love

  • I am not asking about how to do it, but why? Dec 29, 2015 at 13:24
  • I'm pretty sure that argument passed to set_items_per_page should be an integer. Of course PHP will cast it silently, but anyway no need for string constant where integer value is needed.
    – Mołot
    Dec 29, 2015 at 23:37

the function names dont look correct here for the latest version of D8

should be

$view->setItemsPerPage(10); // or any other integer value 

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.