Select the code component to edit.
The system opens the Preview and Component data panels for the component.
Select Add type.
The Content Relationship dialog box opens.
Click Continue.
The dialog box lists every field on that bundle.
Select the checkbox for each field or field property the component needs. To reach the properties of a field, expand the field.
For example, expand Body to select Processed text.
The prop displays the entity type, the bundle, and an Entity fields count.
The Content Relationship dialog box categorizes fields into three groups:
Field Type | Description | Example |
|---|---|---|
Fields with a single property | To provide the component a single value, select the property of the field. | Title |
Fields with several properties | To provide the component an object, select more than one property. | Image fields expose File ID, Alternative text, Title, Width, Height, and Image URL. |
Reference fields | To select fields on the referenced content, expand a reference field. | Reference fields, such as Cover Image, Author profile, and Authored by, display a badge that identifies the associated content type, for example, Image, Person, or User. |
For example: Images are commonly reference fields. A Cover Image field points to a media item and does not contain an image directly.
To reach the image in this example:
The dialog box displays only fields that hold a single value. A reference follows only to a single-value field. Fields such as Tags, Categories, and Related articles hold many values. Therefore, these fields do not appear in the dialog box.
Content entity reference props behave differently from other prop types. The Props tab reflects this behavior and hides controls that do not apply.
Constraint | Description |
|---|---|
Targets one entity type and bundle | To offer authors a choice between bundles, define more than one prop or place more than one component. |
Holds a single value | The Allow multiple values option is not available. To display several entities, add several props or place the component several times. |
Cannot be required | The Required switch is not available because the referenced entity is subject to deletion or might never be selected. The component must handle a missing value. |
Cannot have an example value | The Example value field is not available. Preview values resolve from the real content the author selects. |
After the component is placed on a page, the prop displays as an autocomplete field labeled with the title of the prop. Enter part of the content title to search, then select a result. Authors can select only content of the configured entity type and bundle.
In a content template, connect a content entity reference prop to structured data instead of a manually selected entity:
Place the component on a page, reference an entity, and confirm the component renders the data of that entity. Change a field on the referenced entity and reload the page. The component reflects the new value, because the data resolves at render time instead of at the time of creation.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.