- π¬π§United Kingdom very_random_man
Just came across this whilst looking for something else and thought i'd leave a comment in case other people find this. You can get around the requirement for nasty nested entity/paragraph doom forms by making more use of sections, custom layouts and the layout options and layout builder restrictions modules.
So for example...
- Create a card block.
- Set up a custom layout for the Card Group section and some layout options (see examples below) so you can add a title and a summary. I used a custom options setting which was pretty simple so i could use stuff like rich text fields.
- You then use Layout Builder Restrictions to restrict usage of the Card block so it can only be placed in a Card Group section.I find this significantly simpler from a dev and UX perspective and better than the typical 'all blocks in one column with extra helpings of massive nested forms in a small column' approach. :-)
THEME.layouts.yml
card_group: class: '\Drupal\layout_options\Plugin\Layout\LayoutOptions' label: 'Card group' category: 'Whatever' path: templates/layouts template: layout--card-group default_region: main icon_map: - [ card-a, card-b, card-c ] - [ card-d, card-e, card-f ] - [ card-g, card-h, card-i ] regions: main: label: Card content
THEME.layout_options.yml
layout_option_definitions: card_variant: title: Card variant description: The card variant applied to all cards in this section. plugin: layout_options_class_select multi: false default: default options: default: Default button: Button small: Small layout: true regions: false weight: 1 section_heading: title: Section heading description: An optional heading added to the top of the section. plugin: MODULE_layout_options_setting_textfield default: '' layout: true regions: false weight: -50 section_summary: title: Section summary description: An optional summary for the section. plugin: MODULE_layout_options_setting_formatted_text default: '' layout: true regions: false weight: -40 layout_options: card_group: section_heading: {} section_summary: {} card_variant: {}