Posts

SitecoreForU All Blog Links 2024

Sitecore XM Cloud XM Cloud and Azure Function Power Of Sitecore Module In XM Cloud Creating Component in XM Cloud using Component Builder Common Errors and Limitation in XM Cloud Development Migrate Content Between XM Cloud Environment Steps to Generate Access Token for Authoring API Endpoint in XM Cloud Understanding Search Query With Pagination Using GraphQL In XM Cloud Understanding Forms in Sitecore XM Cloud Sitecore Content Hub External Component In Sitecore Content Hub Using React Sitecore Content Hub One Create and Fetch Content From Sitecore Content Hub One using GraphQL and React Docker Facing Error With Solr Docker Service Not Healthy Switching From Docker Desktop to Docker CLI Sitecore SXA Anti-forgery token validation failed : The required anti-forgery cookie RequestVerificationToken is not present Implementing Custom 301 Redirect in Sitecore SXA Sitecore XP How to write Solr query using SolrNet Sitecore PowerShel...

Sitecore XM Cloud Form Integration with Azure Function as Webhook

Image
Hello everyone, In this blog, we will see, how Azure Function can be used with Sitecore Forms. Before starting, I would request everyone to read my previous blog on XM Cloud Form as I am not going to go deep with how to create forms in XM Cloud. Creating Azure Function : Will serve as our Webhook Creating and Integrating Form : XM Cloud Form Creating An Azure Function I will not explain how you can create Azure Function with Http Trigger. You can check this youtube link here . Also in reference section, I will provide the link how you can connect and deploy your changes to azure function using Visual Studio. Azure Function Code : Its just a starter code which Azure function by default. Creating XM Cloud Form and Integrating with Azure Function Step 1 : Create a form from Form Editor and once form us published, you can see the below view in preview state. Here you can edit your form too. But it always recommended to use a version of that form as whatever changes is done will ...

Switching Docker Desktop to Docker CLI in Easy Way

Hello everyone! In this blog, we'll explore an important aspect of Docker development with Sitecore. Most of us are familiar with using Docker Desktop for our development needs—it's user-friendly and offers a great interface for managing your Docker environment. However, the downside is that it's a licensed product. Let’s explore how Docker CLI can help us eliminate the licensing costs associated with Docker Desktop. We'll also look at how smoothly we can transition from using Docker Desktop to Docker CLI Step 1 : Uninstall Docker Desktop Step 2 : Install Docker Engine and CLI Uninstall Docker Desktop Make sure containers are stopped using following cmdlets: # Leave swarm mode (this will automatically stop and remove services and overlay networks) docker swarm leave --force # Stops all containers docker ps --quiet | ForEach-Object {docker stop $_} If you want to remove all containers, container images, networks, and volumes from your syste...

Automating Tag Update in Sitecore XM Cloud with PowerShell - A Use Case

Managing tags across different environments in a Sitecore setup can be a challenging task, especially when dealing with a large number of items and multiple folders. Automating the synchronization or updating of these tags can save time and reduce errors. In this blog post, we'll explore a practical use case of using Sitecore PowerShell Extensions (SPE) to automate the synchronization of tags between shared and global environments in a Sitecore instance Use Case Imagine you are managing a global website for a large corporation, such as ABC company. Your content is distributed across various regional sites, and each region uses a different set of tags stored in different folders.The respective page content are tagged with site specific tags. However, for consistency,The business ask you to ensure that tags from the shared environment should be used from now on. But there is catch while you make the changes. You need to make sure that all existing website content pages should be ta...

Power Of Sitecore Module In XM Cloud

Image
In this blog, we will explore how to automate the process of creating roles with appropriate permissions when working in a multilingual and multisite environment. As soon as we think about automation, PowerShell scripts are often the first tool that comes to mind. And you’re absolutely right—we will be using PowerShell scripts, but with a twist. We'll leverage Sitecore Modules to approach this differently, integrating the module into the scaffolding definition. This way, whenever a new site is created in XM Cloud, roles and permissions will be automatically set up. So let's quickly start. Before we move forward, I recommend reading my previous two blogs on role creation and assigning proper permissions, which are explained through a specific use case. We'll be using the same use case for our purposes here. Roles Creation Assign Permission We will divide the blog into 2 section. Creating the Scripts Creating the Module Creating the Scripts in Script Library We ...

PowerShell Script For Creating Roles and Permission Part 2

Hello everyone, this is continuation of blog where we have seen how to create appropriate roles to manage content authoring more effectively. You can refer the part 1 of blog here Now our focus will be on assigning the permissions to the roles which was created on previous blog. Let's see the script that is required to update the permission. $siteLanguages = @("en-IN") $siteName = "IN" $siteType = "External" $Organization = "ABC" $region = "Asia" $rolePrefix = "$Organization $siteType $siteName" $siteAccessRole = "$rolePrefix Access" $siteAdminRole = "$rolePrefix Site Admin" $contentAdminRole = "$rolePrefix Content Admin" $contentContributorRole = "$rolePrefix Content Contributor" $contentPublisherRole = "$rolePrefix Content Publisher" $contentPreviewerRole = "$rolePrefix Content Previewer" #Content $regionPath = "/sitecore/content/$Organization...

Common Errors and Limitation in XM Cloud Development

Image
Hello everyone, In this blog, I will try to list down all the posssible error or limitation that is encountered during development in XM Cloud. This blog will be continous blogpost which will be updated over the period of time. This blog will be divided based on two sections. 1. Errors and 2.Limitation Section 1: Errors : Many errors are question asked to Sitecore and they have replied back with answers. 1. Access to fetch at 'https://edge-platform.sitecorecloud.io/v1/forms/data/4b24e4eae68d49cf8eb1692452625d2e-use' from origin '****.vercel.app' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.Understand this error Solution: 1. Added Vercel.json using below code for cors headers": [ { "source": "/(.*)", "headers": [ { "key": "Access-Control-Allow-Origin", "value": ...

PowerShell Script For Creating Roles and Permission Part 1

Hello everyone, As we all know managing user roles and permissions effectively is crucial for maintaining security and ensuring appropriate access within any organization. In this blog post, we'll delve into the user roles and permissions hierarchy at ABC company. We'll explore the different roles, their specific permissions, and how these roles interrelate to form a cohesive and secure system especially when we have multiple website with multisite setup. We will see, how we can implement this using PowerShell. Lets consider, we have a company called ABC which is having corpate website followed by Country level site. The company have below roles. The hierarchy of the Site is ABC(Tenant) --> External(Site Collection) --> IN(Site) ABC Limiter ABC Author ABC External IN Access ABC External IN Content Previewer ABC External IN Content Contributor ABC External IN Content Publisher ABC External IN Content Admin ABC External IN Site Admin Each role...

Migrate Content Between XM Cloud Environment

Image
Hello everyone. In this blog we will discuss how we can migrate content between two different XM Cloud environment. As we all know, how important it is to keep the content sync from production to lower environment. It helps to lower down the risk of error in production as testing can be done more efficiently. In traditional CMS, database restore was one of the most popular way to sync content between environments. But when we are working in XM Cloud, as we all know Its SAAS product, there we don't have control over Databases. So, how we can restore the content on lower environment in such cases? The answer is simple, through package migration. Correct? Nope, package migration is good option when we have very less content and the biggest problem is with media items. Let's see, how Sitecore Serilization helps in this process to resolve our error. We will use Sitecore CLI commands for our rescue. Step 1 : Setting up the Sitecore Serialization. Create a separate folder un...