Note: include and to review/merge after #3628644: Scaffold components config array instead of string
Problem/Motivation
The components the Scaffold panel renders for real must be listed one id at a time. The Bootstrap recipe lists five, grid_row to grid_row_4.
UI Suite themes already group these components as group: Layout in their definitions: Bootstrap and DSFR with their grid rows, UIkit with its containers, grids and sections. Core copies group into the category the Component library panel groups by.
Proposed resolution
- Add a Scaffold setting, a checkbox, off by default: render the components of the Layout group for real.
- A component matches when its group is "Layout", case-insensitive.
- Components matched by the toggle and the ids in
componentsare both rendered for real. - The configuration summary says when the toggle is on.
- The Bootstrap recipe turns the toggle on and drops its five ids.
Remaining tasks
- Land #3628644: Scaffold components config array instead of string first. This builds on its list setting.
User interface changes
A new checkbox in the Scaffold island settings of the profile form.
API changes
None.
Data model changes
display_builder.islands.scaffold gets a boolean, layout_group. No post update: a profile without the setting gets the default, off.
Issue fork display_builder-3628650
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:
Comments
Comment #2
mogtofu33 commentedComment #4
mogtofu33 commentedComment #5
pdureau commented#3628644: Scaffold components config array instead of string is RTBC
Comment #6
pdureau commented#3628644: Scaffold components config array instead of string is merged, so i rebase this one and review
Comment #7
pdureau commentedThe initial idea is great (not having to manage component ID one by on, and working on "Groups" instead) but I am having doubt about hardcoding the "Group" name.
Groups are just documentation label with nothing special about them, and we have no control on them. For example, in DaisyUI, the "Layout" group is called "Grid".
Why not a combination of:
ui_suite_bootstrap:grid_row_*@jean, what do you think about this?
Comment #8
mogtofu33 commentedYes the group is a manual string, it will work only where theme properly use it, which are mostly ours. I had that in mind, that's why I didn't replace the list but made the toggle complementary.
Other option was to expose all groups, but was too much.
I am not sure about the wildcard, we don't do that anywhere as far as I remember, I prefer a specific list of ids so there is no surprise on what's expected and included.
Comment #9
pdureau commentedDisplay Builder is not made for the few UI Suite themes we maintain but for all themes from contrib space
In sample of 33 contrib themes with SDC:
We find only 2 themes using "Layout" group outside of ours:
Unfortunately, a boolean property will be hard to evolve. I can keep the subject on my side until we find something.
Comment #10
mogtofu33 commentedSet postpone until we have a better solution.
Comment #11
pdureau commentedScaffold is not configurable anymore since #3630345: Preview as a switch on the Canvas, and in a new tab, instead of a split view 😱 A change done not mentioned/discussed, just after #3628644: Scaffold components config array instead of string, while we were discussing about the current feature.
What the hell has happened there? What about users currently using existing configuration on this island? And what does that means about this feature?
It is not only about configuration. With the removal of
RealRenderTrait::buildComponentRealRender(), any proposal will also need to propose a way of embedding fragments rendered with front theme.It is too much a mess for 1.0.0.