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 :-)
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | views-extend-block-items-no-3083379-10.patch | 979 bytes | majid.ali |
| #5 | 3083379-extend-block-items-no.patch | 979 bytes | hexabinaer |
Comments
Comment #2
cilefen commentedNew 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.
Comment #4
hexabinaerComment #5
hexabinaerComment #6
sanduhrsThis patch is trivial and a good improvement for sitebuilders.
I'd like to see this included.
Comment #7
alexpottSure 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!
Comment #10
majid.ali commentedPatch for 8.7.10