Problem/Motivation
The list of layouts presented in the Layout Builder UI is provided by a controller, which is not alterable like a form is.
Proposed resolution
The item list can be given a specifier (I forget what it's called in the theme system) that allows for more specific preprocess functions to target it.
Additionally, this gives string array keys to the rest of the render array instead of leaving it as numerically indexed.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#3 | 3096034-layoutlist-3-PASS.patch | 6.67 KB | tim.plunkett |
#3 | 3096034-layoutlist-3-FAIL.patch | 5.47 KB | tim.plunkett |
#2 | 3096034-layoutlist-2.patch | 1.21 KB | tim.plunkett |
Comments
Comment #2
tim.plunkettComment #3
tim.plunkettHere it is with some test coverage. The FAIL patch is equivalent to the interdiff.
(I've renamed the existing layout_builder_field_block_theme_suggestions_test module and test to not only test field blocks, but as a home for all LB theme suggestion tests)
Comment #5
zrpnrThis is a nice improvement, I tested locally and the patches in #3 FAIL and PASS respectively.
This adds a theme hook name which allows this layout to be specifically overridden.
This test shows both that the theme hook suggestion is working and also that the individual element in the list can be changed.
This will make it possible to theme the layout options in the "Add Section" panel, and the tests ensure that this theme hook name won't get removed in the future after contrib modules might depend on it.
Comment #6
webchickLooks like a nice, simple patch.
I inquired with @tim.plunkett as to the BC implications, but there are none.
item_list__boogiedboogiedboo
(direct quote ;)) will resolve to justitem_list
if not found.LGTM! I would go ahead and commit it now, but we are currently in a freeze for RC1.
Comment #11
webchickOk, committed and pushed to 9.0.x and 8.9.x.
I feel that since this is a contributed project blocker, to allow iteration on a known UX headache, and the change itself is non-invasive with no BC implications, it should be backported to 8.8.x as well, but since we're currently in RC for 8.8, I need to get approval on that.
Comment #13
alexpott8.8.x is out of support so this will not be backported :)