Is there a way to extend or customize Sitecore Pages to allow editing droplink
or droptree
in the side panel
for XM cloud
, similar to how we can edit the currently supported fields here https://doc.sitecore.com/xmc/en/users/xm-cloud/configuring-components.html?
3 Answers
As this has gone unanswered, our workaround is to add the field as a rendering parameter with droplist
type. This means we can only get the referenced item's item name
as value and use this as necessary in our front-end component.
The limitation of course is we cannot use field values within the referenced item.
Another workaround is to add the field in the page level. As the Content
tab in Pages
and the Content Manager
supports droplink
and droptree
fields.
https://blogs.perficient.com/2023/10/25/using-rendering-parameters-on-a-xm-cloud-component/
Untested
Based on the information provided in the article you referenced about using rendering parameters on a XM Cloud component, yes, it is indeed possible to customize Sitecore Pages in XM Cloud to allow editing of fields like droplink or droptree in the side panel. The process involves extending the rendering parameters and customizing the serialization of these parameters so that they are correctly handled within the Sitecore Pages Editor environment.
To achieve this, you would need to:
Create a custom rendering parameter template that includes your droplink or droptree field. This is based on the standard rendering parameters provided by Sitecore, as outlined in the blog. Customize the data source for these fields to ensure that they retrieve and display the correct data items for selection in the Sitecore Pages Editor. Implement custom serialization logic to ensure that the selected values from droplink or droptree fields are correctly passed to the front-end components. This involves overriding default serialization behaviors to send the actual values (e.g., color hex codes or text labels) rather than just the item IDs. The blog by Karega Anglin discusses a similar extension for adding a background color parameter to a rich text component, which shows how you could adapt this approach for other parameters like droplink or droptree. This would involve coding changes in the Sitecore environment and possibly customizations to the rendering logic and data handling on the front-end (e.g., using Next.js as in the example).
By using custom pipeline processors and modifying the rendering parameters serialization, as detailed in the blog, you can achieve a setup where editors are able to select values directly from the side panel in Sitecore Pages, with those selections properly reflected on the live site
Currently, Sitecore XM Cloud pages do not support editing fields such as Droplist, DropLink, Multilist, TreeList, or any of their variants with search functionality directly within the Pages interface. Customizing Sitecore XM Cloud is also not recommended. Although you can add these fields to the Pages editor, you will need to use the Content Explorer to make any edits.