For background information about what patterns are and examples of how they are used, see the section that covers the patterns capability.
There are two ways to create a pattern:
- In the Canvas sidebar, click on the Pattern Library and then add a pattern of any type with the red (+) button.
- When editing a composition, click the
...menu on any component within it and choose Convert to Pattern to turn that component and any of its children into a pattern.
You can use a pattern like a regular component by adding it to a composition in a slot. If patterns are available they will appear when you insert a component into a composition in the add to slot list.
Change a pattern
Once a pattern is referenced on a composition, the pattern's component(s) are shown but cannot be edited. This is to prevent accidentally editing shared component data without meaning to.
To edit a pattern, which will change it everywhere it is referenced, you can:
- Click the
...menu on a referenced pattern in a composition and choose Edit Pattern to open the pattern for editing.
- Find the pattern in the Pattern Library and open it for editing.
Sometimes you may wish to 'unlink' from a pattern and make a copy of its contents.
This lets you make a copy of the pattern that can be changed without affecting the original pattern; the copy will no longer have any relation to the pattern.
To do this from the composition editor, click a referenced pattern's
... menu and choose Copy Pattern. The copy will be expanded in place.
There are some limitations of where and how you can use patterns that you should be aware of.
- Creating a pattern from a component type, such as Personalization, Localization, or A/B Test, which inherits its allowed components from a parent slot is not allowed. This is because you cannot determine the components allowed in the pattern with no parent slot.
- Patterns cannot be added as children of an A/B Test or Localization.
- You cannot reference a pattern as the root component of a composition