|
1 |
| -# Overview |
| 1 | +# Extending existing content types |
| 2 | + |
| 3 | +One of quickest ways to customize Page Builder is by changing how _existing_ content types look and behave. End-users can already edit Page Builder's content types in several ways. But sometimes your end-users will want to change the structure or modify properties that do not exist on a given content type. In those cases, you can extend an existing content type by customizing its existing _appearance_ or adding a new _appearance_. |
| 4 | + |
| 5 | +## Appearances |
| 6 | + |
| 7 | +An **appearance** is an XML element in a content type's configuration file that lets you modify existing properties, templates, styles, and form fields, or create new ones. In other words, all Page Builder content types (existing or custom) are extended through appearances. |
| 8 | + |
| 9 | +Many of Page Builder's content types have only one `appearance` element. These include the Heading, Text, Image, Video, Tabs, and more. Other content types have several appearances. For example, the Banner content type has four appearances, as shown here: |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +Page Builder defines these appearances in the Banner's configuration file (`Magento/PageBuilder/view/adminhtml/pagebuilder/content_type/banner.xml`), as shown here: |
| 14 | + |
| 15 | +``` |
| 16 | +<appearances> |
| 17 | + <appearance name="collage-left"...> |
| 18 | + <appearance name="collage-centered"...> |
| 19 | + <appearance name="collage-right"...> |
| 20 | + <appearance name="poster" default="true" ...> |
| 21 | +</appearances> |
| 22 | +``` |
| 23 | + |
| 24 | +Within each `appearance` element, you can change content types in the following ways: |
| 25 | + |
| 26 | +- Add new style properties. |
| 27 | + |
| 28 | +- Add or change templates. |
| 29 | +- Add to or change existing forms. |
| 30 | +- Add new attributes. |
| 31 | +- Move data between elements. |
| 32 | + |
| 33 | +## Banner extension tutorial |
| 34 | + |
| 35 | +In this tutorial, you will extend the Banner content type by adding a new `max-height` style property to two of the Banner's existing appearances: `collage-left` and `collage-right`. |
| 36 | + |
| 37 | +{:width="815px" height="auto"} |
| 38 | + |
| 39 | +## Banner extension steps |
| 40 | + |
| 41 | +These steps show the basic pattern for adding style properties using existing appearances to extend a content type: |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +1. **Create an extension module**: Create a basic module for your Banner extensions. |
| 46 | +2. **Extend appearances**: Extend the existing content type's configuration file by customizing an existing appearance with new style properties. |
| 47 | +3. **Extend forms**: Extend the existing content type's UI component form by adding new form fields and changing defaults for existing fields. |
| 48 | + |
| 49 | +## Next |
| 50 | + |
| 51 | +[Step 1: Create an extension module](step-1-create-extension-module.md) |
2 | 52 |
|
3 |
| -This topic is currently under development. It will be completed by the GA release of Page Builder. |
|
0 commit comments