Posts

Showing posts with the label JSS

Data source and children content resolver

Image
If you worked on a Sitecore JSS implementation you must be familiar with the Rendering Content Resolvers used by the Layout Service to serialize the contents of a rendering data source into JSON. Out of the box, Sitecore comes with the following Rendering Content Resolvers Datasource Resolver    The default resolver which serializes the data source item Datasource Item Children Resolver   Serializes the datasource item's children Context Item Resolver Serializes the context item instead of the data source item Context Item Children Resolver  Similar to Datasource Item Children Resolver but serializes the children of the context item Folder Filter Resolver Serializes not just direct children but also the descendants of the data source item, excluding folders As you can see, there is no out of the box contents resolver that can serialize both the data source item and its children. This will be handy when you have a module that contains a parent data source item and ch...

Fix for the issue with renaming local data sources resulting in broken links

Image
Sitecore introduced local/page data sources with SXA. The local data sources allow better organisation of your page specific and shared data sources. However, one challenge with local data sources is, the links to them won't automatically get updated when you rename them. This is because Sitecore uses the path instead of ID to link to local data sources. If you inspect the raw value of final renderings field of a page with module that has local data source you can see the path "local:/Data/...". For this reason Sitecore warns about renaming local data sources manually. The documentation clearly says you need to convert your local data source paths to IDs using the out of the box scripts provided before renaming the local data source item. (Source: https://doc.sitecore.com/xp/en/developers/sxa/93/sitecore-experience-accelerator/data-sources.html#rename-local-data-sources) The script works fine in most cases, except for when not all your data sources are direct children of ...