Problem/Motivation
We previously had a similar issue, which resulted in the introduction of additional values:
https://www.drupal.org/project/drupal/issues/3083379
While those changes improved the flexibility of Views block management, we still lack several basic options, specifically, values like 8 or 9.
It's a common practice to use grid layouts with 3 or 4 columns. In such cases, having the ability to display 8 items (2 rows of 4) or 9 items (3 rows of 3) is essential for creating comfortable layouts. Currently, this isn't possible, as there are no available values between 6 and 10.
The only workaround is to set the number of items (8 or 9) in the default view configuration. However, this isn't a viable solution when the same view block is reused in multiple places with different layout needs.
Proposed resolution
Extend the list of available values to include all integers from 1 to 10. This change would give site editors more flexibility and allow for commonly used layouts like 3×3 or 2×4 without relying on workarounds.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3534658-extend-the-available-number-of-items-per-view-block.patch | 595 bytes | terry_kolodiy |
Issue fork drupal-3534658
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3534658-extend-the-available
changes, plain diff MR !12658
Comments
Comment #2
terry_kolodiy commentedHere is the simple patch with this improvement
Comment #3
cilefen commentedComment #4
terry_kolodiy commentedComment #6
terry_kolodiy commentedComment #7
terry_kolodiy commentedComment #8
smustgrave commentedProbably something that will need sub-maintainer sign off.
But probably should have test coverage too.
Comment #10
terry_kolodiy commentedComment #11
smustgrave commentedChanges look good to me. will try and get sub-maintainer to take a look.
Comment #12
quietone commentedI see that @smustgrave asked for tests but I am not convinced that the test in this MR is needed. It is only testing that the '#options' of a 'select' item are displayed. Surely that is tested elsewhere.
Comment #13
terry_kolodiy commentedHi @quietone,
I’ve removed the test, so the MR now only includes the plugin change. I believe it’s ready to be merged.
Please review it and let me know if anything else is expected from me :)
Thank you!
Comment #14
catchAgreed we don't need a test here. This has been RTBC for a while and is a trivial change, so going to go ahead and remove the subsystem maintainer review tag, don't think it's controversial.