Posts

SitecoreForU All Blog Links 2023

Sitecore Content Hub Understanding Media Prcessing Workflow in Content Hub Extracting Metadata Properties and updating custom Schema Field for Asset Details page Creating Custom Component in Content Hub using External Component Creating Email template programmatically in Sitecore Content Hub Sitecore OrderCloud Creating and Fetching Product in Sitecore OrderCloud using Sitecore OrderCloud .Net SDK Understanding Product Variant in Sitecore OrderCloud and reading using Sitecore OrderCloud .Net SDK Understanding Security Profile in Sitecore OrderCloud Understanding Different Authentication Method Available in Sitecore OrderCloud Understanding Buyer User Group Introduction To Sitecore OrderCloud Federated Authentication Understanding OAuth 2.0 and OpenID Connect with Sitecore OAuth 2.0 and OpenID implementation in Sitecore Website Headless and GraphQL Reading Sitecore GraphQL data in Next JS Creating First Headless component - Site...

Getting 403 Forbidden Error When Using SXA CLI Commands

Image
Hello everyone, In this blog we will see a common error(403 forbidden) that usually comes up whenever we try to push something(Themes related changes) using SXA CLI to Sitecore Instance and how we can solve it. So let's begin. Whenever we use any SXA command like sxa watch or sxa upload which pushes the recent changes to your configure Sitecore Instance and you are getting 403 forbidden access eventhough your minification is showing success as shown below Solution: Just check your z.SPE.Sync.Enabler.Gulp.config file is disabled.If yes, then make it enable as it has configuration for media file upload to instance. Path : wwwroot/App_Config/Include/z.Feature.Overrides/z.SPE.Sync.Enabler.Gulp.config Hope this will help. Thanks for reading. Happy Sitecore learning!!! You can check my other blogs too if interested. Blog Website

Tips And Tricks While Upgrading Sitecore Docker Solution

Image
Hello everyone, I would like to share my experience while upgrading Sitecore 10.1 SXA to Sitecore 10.3 SXA. Our solution was based on Docker, so will try to provide some quick tips for the same. Also will provide some docker commands, that were really helpful during the upgrade process. I will divide the blog section into 2 parts, one for local upgrade and another for higher environment upgrade. Local Upgrade Step 1 : Navigate to Sitecore 10.3 download page. Download the container based package.Also download the upgrade guide form there. Once downloaded, you will get below folder structure. Here Below image has detail for how to upgrade the Database. The two important file is docker-compose-upgrade.yml and upgrade.env file. In local we can run this component directly by below command. Just fill the upgrade.env with your local instance. But for local, instead of upgrading, go with new instance . Add all module as layer in your docker image files. Then you can restore your content i...

Creating Media Processing Flow in Sitecore Content Hub

Image
Hello everyone, In this blog we will learn, how we can add media processing workflow in Sitecore Content Hub. We will see with a use case. Use Case: When we will upload or refresh a JPEG asset entity, It will create a PNG rendition of that Asset. Checkout the below screesnhot which will help you to configure steps for creating a media processing flow. Step 1: Manage page --> Search Media Processing --> Click the Media Processing --> It will open the page Step 2 : Click on Content --> Click on Image --> It will open main page where we will add a flow Step 3 : Add new Task by Clicking + icon --> Click on Convert Image task --> Fill the parameter section. Specifying Content type is very important . Step 4 : Go to ouput section and configure the parametes. Give the label which will will shown in output name for the png rendition.Once done save task and save the flow and publish the media processing flow. Step 5 : Once published, come back to Asset Search P...

Upgrade SXA Themes Using SXA CLI from Sitecore 101 to Sitecore 103

Image
Hello everyone, In this blog we will learn how we can migrate Sitecore npm packages from myget to nuget and also how we can upgrade the SXA CLI Themes from 10.1 to 10.3 version. Recently, I was working on Sitecore 10.3 SXA upgrade project.This was container based application both for local and higher environments. In this project we were using Sitecore SXA CLI 10.1 to push our themese related changes to our Sitecore Instances and we have to upgrade it to 10.3 for the same. We came across two hurdles in that. First of all we have to migrate Sitecore npm package dependecies from https://sitecore.myget.org/f/sc-npm-packages/npm/ to https://www.npmjs.com/package/ . The second hurdle was to update the Themes itself. I will try to provide the approach that we have followed and it has worked for us. Step 1 : We will removed the old sitecore npm package url. In 10.1 we use to set the old url in internal npm configuration. If you want you can manually remove it by navigating to C:/users/{{yo...

Creating New Themes Using SXA CLI

Image
Hello everyone, In this blog we will discuss, how we can create a new theme in SXA using SXA CLI. This will be a short blog so let's quickly start with it. Step 1: Install SXA CLI globally using below command. Navigate to PowerShell and open it using Administrator mode npm install -g "@sitecore/sxa-cli@10.3.0" Step 2: Create a folder in any drive.For us we have created Theme under C drive. Open that folder in PowerShell.Execute the below command one by one. C:\>cd Theme # First we need to register our CM url C:\Theme>sxa register https://sc103.localhost # Command for creating new theme C:\Theme>sxa new customtheme # Some option will be asked. Provide the input as per your need ? The theme will be created for instance based on url https://sc103.localhost. Do you want to specify a different url? no # Will ask you to login to Sitecore instance ? Enter your login {username} ? Enter your password [hidden] {password} # Will ask y...

Creating Email Template In Content Hub Programmatically

Image
Hello everyone, In this blog we will see, how we can create mail template programatically in Sitecore Content Hub. So let's quickly try to see the code and we will understand it afterwwards. using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; using Stylelabs.M.Sdk; using Stylelabs.M.Sdk.Models.Notifications; using Stylelabs.M.Sdk.Contracts.Notifications; using Stylelabs.M.Sdk.Contracts.Base; using Stylelabs.M.Sdk.Contracts.Content; using Stylelabs.M.Base.Querying; using Stylelabs.M.Base.Querying.Filters; CultureInfo culture = CultureInfo.GetCultureInfo("en-US"); MClient.Logger.Info($"SS - Creating Email Template"); IMailTemplate template = await MClient.EntityFactory.CreateAsync(Constants.MailTemplate.DefinitionName) as IMailTemplate; template.Name = "MailNotificationReject"; template.SetSubject(culture, "SS Mail Notification Reject"); template.SetBody(culture, "Email...

Running Database Clean Up Task Manually After Sitecore Upgrade in Docker

Hello everyone, In this blog we will see how we can run database clean up task manaully using Sitecore CLI and why it is important especially during upgrade. Recently, we were working on Sitecore upgrade project from 10.1 to 10.3. Our solution was based on Docker setup. If you go through Sitecore Upgrade guide for container, you will find that Sitecore provide mssql-upgrade docker image which takes care of upgrading the SQL schema and tables required for the required Sitecore version to function properly.But if you closely observe during sql upgrade, you will see Sitecore modules are not updated during the process. Sitecore documentation guide provide information how we can upgrade different Sitecore module which is used in the solution. In our solution, we were using Sitecore PowerShell and Sitecore SXA module.Also in Sitecore 10.3, Sitecore is providing this module as Item As Resource( .dat files ) instead Sitecore Items in the package. So whenever we are upgrading, we need to remo...

PowerShell Script to update Alt tag missing for Images

Hello everyone. I am back with another powershell script that can be very useful if you want to update alt tag missing for all images in sitecore.We all know, how important is alt tag from SEO perspective and that's why, this powershell script can come very handy when we have lot of missing alt tag for images. Below is the powershell script for your reference.The script is pretty simple to understand. $rootPathOfImages = "/sitecore/media library/Project/" $testMode = $false $secondsToWaitOnLimitError = 60 $successCount = 0 $errorCount = 0 $errorList = "" $date = Get-Date $formattedDate =$date.tostring('dd-mmm-yyyy-hhmmss') # List of template ids to exclude from processing $excludedTemplateIds = @( "{FE5DD826-48C6-436D-B87A-7C4210C7413B}", #media folder "{0603F166-35B8-469F-8123-E8D87BEDC171}", #pdf "{16692733-9A61-45E6-B0D4-4C0C06F8DD3C}", #doc "{7BB0411F-50CD-4C21-AD8F-1FCDE7C3AFFE}", #...

Creating Custom Component in Content Hub using External Component

Image
Hello everyone, In this blog, we will see how we can add an custom component in Content Hub. We will create a component which will display all related assets based on loaded Asset title. Creating custom component depends on utilizing External Component.So we will follow below steps to achieve the same. We will be using Knockout JS for the implementation. Step1 : Adding External Page Component to Asset Detail Page Step2 : Code Logic implementing Related Asset Component Step 1 Go To Manage Page --> Search Pages --> Search Asset Details. Select Any row and click on add component basically the + symbol. In above screenshot, just click the plus symbol below Related Asset component.A popup will come up. Search for External keywork in search bar and click the result which comes up.Another popup will come and we will give our component a name and enable the visisble checkbox as shown below and click Add.The component will be added to layout. Once the component is added, just c...