Posts

Showing posts from August, 2023

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

Creating First Headless component - Sitecore Next JS

Image
Hello everyone, As my learing continues in Sitecore Headless, In this blog we will see how we can create component in Sitecore Headless Next JS. We will take an example of how we can create a Footer component . Also we will try to use all Sitecore fields that are mostly use in our day to day work and how we can render those fields(Rich Text, Link, Multilist, Image, Dictionary etc.) in Headless development. Let's describe the footer component. It has fields mentioned. Footer Label, FooterLogo with Link, Description and List of external links. Footer Label : Dictionary Item FooterLogo : (Image) with Link :(General Link) Description: (Richtext) List of external links : (Multilist) Lets see the Sitecore Structure: Templates Renderings Datasoure Item Placeholder Settings Home Item Presentation Details once we add the component, we can check the same in Layout Service. Layout Service Now after verifying the component in Layout service, its time to build the read t...

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

Playing with GraphQL Query with Sitecore Headless Next JS

Image
Hello Everyone, In this blog let's try to understand some basic GraphQL query that we can use while working in Sitecore Headless Project. I just started learning GraphQL, so thought of sharing my learning with you with some practical scenario that we can encounter.In this blog we will see to fetch normal fields and Multilist field using GraphQL. So Lets get straight to the Point. Imagine a scenario where we are reading Tiles component. We need to show list of Tile along with Tile Header. In this scenario, most of the time we will create a datasource item. That item will have two fields one will be Tile Header and another will be TilesList which will be a multilist field. Also on Top of that, if we want to get some data from Page Item(ex.Home page) like Page Title and Page Description, how we can use GraphQL to get all these datas. Below images are representing the Sitecore CMS structure for the same. TileList Datasource Item Tile Item Home Page Item Now lets see how we c...