Problem/Motivation
We need to restore this feature used by Layout Builder:
$layout = new LayoutDefinition($definition);
if (isset($component['icon_map'])) {
$layout->setIconMap($component['icon_map']);
}
if (isset($component['thumbnailPath'])) {
$layout->setIconPath($component['icon_path']);
}
if (isset($component['icon_path'])) {
$layout->setIconPath($component['icon_path']);
}
Example of icon_map in a component definiton:
icon_map:
- [top]
- [first, second]
- [bottom]
And it is also the opportunity of leveraging thumbnailPath in layout builder:
- if you put a file named
thumbnail.pngin your component folder, SDC is settingthumbnailPathproperty in definition - if we have
thumbnailPathand noticon_pathin the definition,icon_path=thumbnailPath
Proposal:
$layout = new LayoutDefinition($definition);
if (isset($component['icon_map'])) {
$layout->setIconMap($component['icon_map']);
}
if (isset($component['thumbnailPath'])) {
$layout->setIconPath($component['icon_path']);
}
if (isset($component['icon_path'])) {
$layout->setIconPath($component['icon_path']);
}
Related issue, but for component selector instead of layout builder #3469795: [2.2.0] Component selector: use SDC's thumbnailPath?
Issue fork ui_patterns-3473804
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 commentedDid we lost other mechanisms when we moved from hook alter to deriver?
Comment #5
just_like_good_vibesdone
Comment #6
pdureau commentedHowever:
Comment #8
just_like_good_vibesComment #9
pdureau commented