Posts

Showing posts with the label Sitecore SXA

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

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...

Custom Scriban Object processor in SXA

Image
Hello everyone, In this blog, we will learn one more important concepts in Sitecore SXA and i.e. Custom Scriban object. As scriban was introduced in Sitecore 9.3 SXA, more developer started using Scriban while creating rendering variants. By default Sitecore provide a number of built-in Scriban Objects which you find on the Sitecore document site Link . Still there are time, where we need to create our own custom Scriban objects and we will see this here, how we can implement it. Let's take a use case: Reading Dictionary directly inside Scriban template. For this we don't have any built-in object and we will implement it using custom Scriban Object. Steps for creating Custom Scriban Object Creating custom Scriban processor inheriting from IGenerateScribanContextProcessor Registering the Processor under generateScribanContext pipeline So lets see the code without wasting any more time. Step 1: Create a Custom Scriban Processor ( GetDictionary ). Inherit the class from Add...

AddToAny Social Share for Sitecore

Image
Hello everyone, if you are working in Sitecore SXA, you might have seen that Sitecore SXA module AddThis might have stop working automatically. The reason behind this is Oracle who was supporting AddThis has discontinued its services from 31st May 2023.You can find the details in below Link So, recently we were trying to look out the easiest way of replacing the AddThis module with bare minimum effort. After researching, we found three suitable option which can be used instead of AddThis module. ShareThis Shareaholic AddToAny We went ahead with AddToAny module as it was the most simplest way for implementing the Social feeds sharing and it was exactly similar to AddThis module. Let's see how we can implement the same. AddToAny Navigate to AddToAny website on link mentioned above and you should get below screen. Hover on Get The Share Buttons and Select Website. You will be navigating to another Url : https://www.addtoany.com/buttons/for/website Now you can see on the page...

Custom Component Rendering in Sitecore SXA

Image
Hello Everyone. In this blog, i am going to explain you that how we can a create custom SXA controller rendering. As we all know SXA provides most of the component OOTB only but still there are time where we need to create our own controller rendering to meet business requirements. As a traditional Sitecore developer, we could have easily create Controller rendering and used it to add in Page but when we are working in SXA, there are some standard rules which we need to follow while developing a Custom SXA Controller rendering. We will understand this with a example. Let's consider, we have requirement to develop a form. The form has two variations which is listed below. Normal Form Form on top of Hero Banner Let's see how we can develop this component First Way : We can use Sitecore Forms for normal form Or we can create Rendering Variant of Page Content. Create Scriban template to create the Hero Banner Component.Then again use Component variant field to add Form Compon...

My Sitecore Upgrade Learnings Part 2

Image
Hello Everyone, This is second part of  My Sitecore Upgrade Learnings. In previous part we have seen, how to upgrade Sitecore from one version to another. You can refer the same in link Part1 . In this blog, we will try to cover the backend code part upgrade required for the same. There are many ways in which we can upgrade the code part listed below. Updating the Sitecore DLL using Package Manager Console for all the projects in your current solution Using a Powershell Script to update the Sitecore DLL for all the projects in your current solution The First option is fairly simple. Open any project of your solution, Click on references --> Manage Nuget Package. Once Nuget Package is open, then you will see the installed version of Sitecore DLL. Click on Update tab and you will be able to see the updated version. Just select the version as per your need and click on update. It will also update all the dependent DLL for that version. There is one more option to update th...

My Sitecore Upgrade Learnings Part 1

Image
Hello Everyone, In this blog I will share my learnings and experience while working on Sitecore upgrade project. Recently we migrated our Sitecore solution from 9.2 with SXA to Sitecore 10.2 with SXA. I will also share my experience regarding what was our approach to implement the same. Sitecore already have a very good document which clearly explains what is needed to upgrade the Sitecore version. If you are upgrading from version prior to Sitecore 9 that this blog will not be that much useful but still you can refer this for some learning purpose. So let's get started. We were having a Sitecore managed cloud in 9.2 with compatible SXA 1.9 installed on it. We started with following approach mentioned below. We got a new Sitecore Manage cloud instance with 10.2 version We installed the Compatible Sitecore PowerShell (6.3 IAR) and SXA version (10.2.0) with respect to 10.2 After successful installation on CM environment, we required to deploy respective SXA modules on CD environmen...

SXA Variant Token Resolver for Breadcrumb

Image
Hello everyone, I am back with another blog. This time we will discuss something about SXA variant token and how it is useful while creating rendering variants in SXA. We will also discuss a scenario where Variant Token helped us to achieve the required functionality. Let's start without delaying. We were asked to implement a search functionality in SXA. If user search for any keyword, then user must be redirected to search result page where he will be shown all the matched result. So whoever has worked on SXA will be thinking that its simple to implement the required ask using SXA OOTB functionality.  Steps we will be following to achieve the same is: 1. Use the Search Box OOTB component. 2. Configure the required search scope query in Search Box Component 3. Give the Signature and configure the required Search Result Page where the user should be redirected, when someone search for something. 4. On the Search Result Page where we are showing the user all matched results, we will ...