-
Notifications
You must be signed in to change notification settings - Fork 0
Using patterns in layout builder
Stephen Mustgrave edited this page Aug 15, 2024
·
2 revisions
Perquisites
- Layout builder
For this example we are going to use fields to render an "Alert" component.
Before getting started we created a new content type "Layout Builder". Added 2 fields to it "Header" and "Content".
- While in layout builder, click "Add section". This will show all components are available layouts.
- Selecting "Alert" will show available props and variant options, in this example I show "Informative"
- After saving the layout you'll see 2 "Add block" sections that correspond to the 2 slots of the component, see https://git.drupalcode.org/project/ui_suite_uswds/-/blob/4.0.x/components/alert/alert.component.yml
-
Adding "Header" to the first slot and "Content" to the 2nd.
-
Go to https://drupal-govcon-2024-ui-patterns.ddev.site/node/15 to see an example page using the component.
Using the same content type
- Add a new section, using Summary box.
- Add "Header" field to first slot.
- Add "Content" field to second slot.