Problem/Motivation

It's awesome that we can decide how many items in a views block will be displayed on block level.

It would enhance the usability a lot if the default numbers would better suit current layout styles: Views rows will more often be styled as flex boxes in a layout grid rather than lines of text below each other.

Currently the default numbers to choose from for "Items per block" are: 5, 10, 20, 40.
(core/modules/views/src/Plugin/views/display/Block.php)

Proposed resolution

12 is a number that can be places in layout grids way better (dividable by 2, 3, 4, and 6).

Of course current options should not be replaced. I propose to add some more option, giving sitebuilders more flexibility.

Even nicer would be a solution to use the custom "Exposed items per page options" from the view itself (could be set without actually allowing the users to control the displayed number).

However, I'd like to extend the options as follows:
1
2
3
4
5
6
10
12
20
24
40
48

This would be my second core contribution if no one objects :-)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hexabinaer created an issue. See original summary.

cilefen’s picture

Version: 9.x-dev » 8.8.x-dev

New features go into the development branch. 9.x is a vestigial branch and we use it here only for tracking issues that truly cannot exist in Drupal 8.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

hexabinaer’s picture

Assigned: Unassigned » hexabinaer
hexabinaer’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +Usability
FileSize
979 bytes
sanduhrs’s picture

Status: Needs review » Reviewed & tested by the community

This patch is trivial and a good improvement for sitebuilders.
I'd like to see this included.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Sure why not. This makes sense to have a few more options here.

Committed and pushed ef16feda76 to 9.0.x and eba4ed3451 to 8.9.x. Thanks!

  • alexpott committed ef16fed on 9.0.x
    Issue #3083379 by hexabinaer: Extend the available number of items per...

  • alexpott committed eba4ed3 on 8.9.x
    Issue #3083379 by hexabinaer: Extend the available number of items per...
majid.ali’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.