Problem/Motivation
Today, we need to put the "#" prefix everywhere it is expected by the render API, and we are forced to put doublequote around those properties.
"#type": "pattern"
"#id": "grid_row"
"#fields":
content:
- "#type": "pattern_preview"
"#id": "card"
"#variant": "default"
- "#type": "html_tag"
"#tag": "div"
"#attributes":
class:
- py-5
- bg-light
"#settings":
with_container: true
gutters: g-3We need to be able to do that instead:
type: pattern
id: grid_row
fields:
content:
- type: pattern_preview
id: card
variant: default
- type: html_tag
tag: div
attributes:
class:
- py-5
- bg-light
settings:
with_container: true
gutters: g-3
Proposed resolution
UI Patterns 2.0.x has a a methods which looks interesting:
ComponentElementAlter::processStoriesSlots()
Let's investigate
API changes
yes, but not breakable. Prefixed properties will still work
We also need to add a test
Issue fork ui_examples-3414730
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
pdureau commentedComment #3
pdureau commentedWe may need to fix something in ComponentElementAlter::processStoriesSlots() before
Comment #4
pdureau commentedOnce this issue is done, we can borrow the logic: #3477573: [2.0.0-beta4] Better stories slots processing
Comment #5
grimreaperComment #6
pdureau commented#3477573: [2.0.0-beta4] Better stories slots processing has been merged
Comment #8
grimreaperComment #9
pdureau commented