Posts

Showing posts from May, 2025

Moving Roles From Traditional XP To XM Cloud Using Sitecore Serialization

Hello everyone! In this blog post, we'll explore an essential concept in Sitecore — Sitecore Roles — which remains relevant across all platforms. Recently, I was working on a migration project where we needed to move Sitecore roles from a traditional XP solution to XM Cloud. Naturally, the first solution that came to mind was using Sitecore Serialization, as it's the go-to method for item migration. However, I quickly discovered that this approach doesn’t work as expected — roles cannot be serialized as IAR files. So, what now? After diving into the Sitecore documentation, I found the right approach — and I’m sharing it with you in this blog. Keep reading to find out how to successfully migrate roles to XM Cloud! The solution is that we need to module.json file which defined your roles only. The change will be that this should be deploy to your XM cloud instance as part of post deploy action mentioned in xmcloud.build.json file Step 1: Create a Foundation.Roles.module.jso...

Extend Page Props Factory in Sitecore XM Cloud to Inject Custom Data into the Layout Service

Image
Hello everyone! In this blog, we'll explore how to extend the page props factory plugin to add our own custom fields. We will take a realistic example to understand the concepts. XM Cloud is based on the SXA framework. In SXA, there was an option to add and manage the favicon directly from the CMS. However, this functionality is not available in XM Cloud. Instead, the favicon is typically placed in the public directory of your Next.js application to ensure public accessibility. If you want the favicon to be managed exclusively through the CMS, what approach can be taken to achieve this? So let's get started with CMS changes.First Step will be to add favIcon template with favIcon field. Second will be to add that template as base template for your main Settings item. Follow the below screenshot. Let's see the FE changes that we need to do. Create a new file called CustomContextResolver.ts under lib --> page-props-factory --> plugins Add the below code. Check...