On the top right, click Edit to open Drupal Canvas.
In the left toolbar, click the Code </> icon to open the code-based components menu.
Select the component in the list to which you want to add or edit a prop.
The system opens the code Editor for the component and displays the Preview and Component data panels on the right.
In the Component data panel on the right, locate the Props tab.
On the top right, click Edit to open Drupal Canvas.
In the left toolbar, click the Library (+) icon to open the Component Library.
On the Components tab, locate the component in the list to which you want to add or edit a prop.
Click the Ellipses (...) icon for the component.
Select Edit code from the menu options.
The system opens the code Editor of the component and displays the Preview and Component data panels on the right.
In the Component data panel on the right, locate the Props tab.
To add a prop:
Access the Props tab for the component for which you want to create a prop.
Click + Add.
Define the prop name, type, and associated configuration values. The available configuration fields vary depending on the selected prop type.
(Optional) Click + Add to add additional props.
The multi-value option is available only for specific prop types. Supported types include Text, Link, Image, Video, Date and time, Integer, Number, List: Text, and List: Integer. The system does not support multi-value properties for Formatted Text and Boolean types. For unsupported types, the system hides the Allow multiple values option from the interface.
Content entity reference props are limited to a single value; the Allow multiple values option is not supported. To reference multiple entities, you must either add a separate prop for each entity or place the component multiple times.
To set up a multi-value prop:
Site builders and developers can expand the capabilities of components already placed on pages. You can evolve these components while they remain in use across your site. The system manages the transition of existing content to the new component definitions to ensure data integrity while providing flexibility.
When editing a component that is already in use, you can perform the following actions:
Add optional props: Add new optional properties to a component. Drupal Canvas does not backfill example values to existing instances. The new settings display the next time a content creator edits that specific component.
Add required props: Add a required prop to an in-use component if an example or default value is provided. Drupal Canvas uses the default value to auto-fill existing instances so the page does not break. Changing a prop from optional to required follows this same rule and must have a default value present.
Make props optional: Change an existing prop from required to optional.
Update values: Update the default or example values for props. Drupal Canvas does not backfill these updates to instances on pages you have already saved. Because saving a page stores a copy of the current value for that instance, subsequent changes to the default value will not affect that content.
Delete props: Remove props that are no longer needed.
However, to preserve data integrity, there are strict limitations. After you add a component to the library, you cannot perform the following actions on an existing prop:
Change the Prop name.
Change the Type of the prop.
Change a single-value prop to a multi-value prop. You cannot select the Allow multiple values checkbox after you create the prop.
To achieve any of these restricted changes, you must delete the existing prop and create a new prop with the desired configuration.
Access the Props tab for the component for which you want to edit the prop.
Edit the prop as needed.
Publish the changes.
Click and hold the Drag handle icon of the prop you want to relocate.
The system displays the hand icon.
Drag and drop the prop in the new location in the props list.
Publish the changes.
If a feature prop is no longer needed, you can remove it from the code component. The database retains the data only until you publish the content again. This retention prevents data loss from an accidental deletion. However, the system no longer renders this data on the live site or displays it in the Drupal Canvas Editor.
To delete a prop:
Access the Props tab and locate the prop that you want to delete.
Click the Delete icon associated with the prop.
The system deletes the prop.
The following table provides example implementations of Drupal Canvas code components for available prop types.
Name | Example Usage |
|---|---|
Text | Single: Multiple: |
Formatted Text | |
| Link | Single: Multiple:
|
| Image | Single: Multiple: |
| Video | Single: Multiple: |
Boolean | |
| Integer | Single: Multiple: |
| Number | Single: Multiple: |
| List: text | Single: Multiple:
|
| List: integer | Single: Multiple: |
| Date and time | Single: Multiple: |
Content entity reference | |
Content entity reference props connect a component to existing content, ensuring it always displays live, up-to-date information without data duplication. These props deliver an object containing your selected fields. If no content is referenced or the referenced content is deleted, the prop value is null. For detailed field-selection steps, object structure, and developer guidance, see Content entity reference props.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Boolean | |
| Integer | Single: Multiple: |
| Number | Single: Multiple: |
| List: text | Single: Multiple:
|
| List: integer | Single: Multiple: |
| Date and time | Single: Multiple: |
Content entity reference | |
If this content did not answer your questions, try searching or contacting our support team for further assistance.