Posts

Showing posts with the label XMC

Modernizing Sitecore Pages: Script-Based Removal of Default Components After Page Design Adoption

Hello everyone, In this blog I will share one most important powershell script that I personally extensively used while working on XMC migration project. Our migration project was from XP to XM Cloud which had whole UI redesign but Sitecore CMS structure remain same. Intially, while migration we followed the traditional Sitecore approach to add the renderings to standard value of the template as they were added in legacy. But when most of the component was developed, we though of utilizing the Page Design and Partial Design feature of SXA. The most commong thing which can go to page design and partial design was header, footer, breadcrumb etc which was common for all pages. Now the major problem here was, in legacy, Header and Footer for example was added manually to page level items. So we faced duplication issue as the components are coming from page design as well as standard values. To overcome this issue, the best solution was to remove the components from standard values of te...

Implementing a Custom 404 Error Page in a Sitecore XM Cloud Multi-Site Project

Image
Hello everyone, in this blog we will see how we can implement our custom 404 error page in XM Cloud project. This blog is very helpful when you are working in multisite solution with single Front End project. It means in front end, we have single repository only. XM Cloud starter repo comes up with default 400 and 500 pages but there is limitation with next js implementation. You can find detail discussion for error page limitation in this github channel here In Sitecore documentation also, its clearly mention about the same. Let me give a small information about what's the limitaion. When any page you search which is not available on your site, the page is redirected to Next JS 404 page. This 404 page then internally calls the GraphQLErrorPagesService class which internally calls grapghql query to fetch the error page configured for your site in Sitecore. This is implemented using component level data fetching. So when the page build happens for SSG, it is unable to identify wh...

CI/CD Made Easy: Bitbucket to XM Cloud and Vercel

Image
In this blog, we’ll explore how to integrate a Bitbucket CI/CD pipeline with XM Cloud. Recently, we worked with a client who used Bitbucket to manage their repositories, and we discovered that integrating XM Cloud with Bitbucket isn’t as straightforward as it is with Azure DevOps. So, let’s walk through how you can achieve this integration using Bitbucket. We will divide this blog in 2 parts. Part 1: Creating project in XM Cloud Part 2: Setting Up the CI/CD pipeline Creating project in XM Cloud When working with Bitbucket, you can use the XM Cloud portal to create a project; however, you won’t be able to link it directly to Bitbucket due to the lack of native integration. To set this up, you can follow these steps: Create a repository in Bitbucket by using import repository options. Clone the repository to your local machine. Push the entire XM Cloud project codebase to Bitbucket. Use the Sitecore CLI deploy app command to deploy the code from your local environment ...

Optimizing Sitecore Branch Templates for Seamless Page Creation Without Datasource Path Modification

Hello everyone, in this blog, I’ll address a common challenge I’ve faced when using branch templates to create item structures. I noticed that when creating a branch structure and assigning a local datasource item, the datasource does not update automatically during item creation—the local datasource continues to reference the branch’s local items. In this blog, we’ll explore how to use a Sitecore pipeline to automatically update the datasource path. This solution will work with all version of Sitecore even if it is XMC, Headless or XP. I have tried this on XMC and it works absolutely fine Let's jump to solution. We will override AddFromTemplateProcessor and extend it to add our logic. Let's create AddFromBranchPresetProcessor which extends AddFromTemplateProcessor . Check below code. using Sitecore; using Sitecore.Data.Fields; using Sitecore.Data.Items; using Sitecore.Diagnostics; using Sitecore.Layouts; using Sitecore.Pipelines.ItemProvider.AddFromTemplate; us...