In the left toolbar, click the Code (</>) icon to open the code-based components menu.
Select the component to which you want to add or edit a slot.
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 Slots 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 Component tab, locate the component in the list that you want to add or edit a slot.
Click the Ellipses (...) icon for the component.
Select Edit code from the menu options.
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 Slots tab.
To add a slot:
Access the Slots tab for the component for which you want to create a slot.
Click + Add.
Provide the following information for the slot:
Slot name: Enter a unique name for the slot.
Example HTML/JSX value: Enter the code that determines how the slot content renders by default.
(Optional) Click + Add to add additional slots.
Site builders and developers expand the layout capabilities of components already placed on pages. You can evolve these components while they remain in use across a site. The system manages the transition of existing content to the new component definitions to ensure data integrity and provide flexibility.
When editing slots within a component that is already in use, you can perform the following actions:
Add new slots: Add new slots to existing components without re-creating them. Existing instances on your site continue to function. The new layout region displays the next time a content creator edits that specific component.
Update values: Update the default or example values for slots.
Delete slots: Remove layout regions that are no longer needed.
However, to prevent layout breaks and preserve data integrity, there is a strict limitation. After you add a component to the library, you cannot perform the following action on an existing slot:
Change the Slot name.
To achieve a name change, you must delete the existing slot and create a new slot with the desired name. The system treats renaming a slot as a deletion of the old name and an addition of a new name. This action causes any child components stored in the original slot to be hidden.
Access the Slots tab for the component for which you want to edit the slot.
Edit the slot as needed.
Publish the changes.
Click and hold the Drag handle icon of the slot you want to relocate.
The system displays the hand icon.
Drag and drop the slot in the new location in the slots list.
Publish the changes.
If a slot is no longer needed, you can remove it from the code component. After you delete a slot, any child components that were placed in that slot will no longer be visible on the live site or in the Drupal Canvas Editor.
The system retains the deleted data in the background until the page is explicitly saved. If you accidentally delete a slot and hide its child components, you can re-add the slot with the exact same name before you save the page. The system restores the child components so they reappear in their original locations.
To delete a slot:
Access the slots that you want to delete.
Click the Delete icon associated with the slot.
The system deletes the slot.
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.