Posts

Sitecore Content Serialization With CLI: Part-2

Image
Sitecore Content Serialization is the development process, in which we move content changes between different environments. It allows us to pull, push, publish items and create packages for the various environment. With the release of Sitecore 10 came two new tools that support content serialization—the Sitecore Command Line Interface (CLI) and Sitecore for Visual Studio. In the Sitecore content Serialization using CLI developers need to configure modules, a set of rules to control what item you want to serialize and how you want to control the pull, push, and other option in your project. In the continuation of my previous blog on Sitecore Command Line Interface , in this blog, I am going to discuss with you Sitecore Content Sterilization using CLI. Install Sitecore Management Service: Sitecore Management Services is a package that you must download and install in your Sitecore Content Management (CM) instance to support Sitecore Command Line Inte

Sitecore Command Line Interface: Part-1

Image
The Sitecore Command Line Interface is a new feature with Sitecore 10 and higher versions. It provides the ability to login into the remote Sitecore instance, serializes items, and publish, package, and additional commands reference for the command line. I have divided this blog post series into the below section: Configure Sitecore CLI on the workstation Sitecore Content Serialization with CLI Sitecore Content Serialization with Visual Studio You may have seen several blog posts, and videos on the same, but in this blog, I will make it easier for you and you do not need to set up the Sitecore project using Helix-base or getting a start template. In the first blog of the series, I will let you know about configuring Command Line Interface on the developer workstation. Once it will configure you can utilize another tool with Sitecore which is Content Serialization using CLI and Visual studio. Sitecore Command Line Interface (CLI) allows con

Getting Start With Docker: Part-1

Image
What is Docker? Let's say you created an application and it's working fine on your local machine, but in QA or Prod, it's not working properly. So, it's a common statement that it's working on my machine does not know why it's not working there😊. The reason can be libraries, version mismatch, framework, dependencies or you have upgraded any dependencies to solve the issue and forget, or any other reason and other developer machines and environments do not have all of these. Hence Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to build and share containerized applications and microservices using containers. Docker is an open-source project for automating the deployment of applications as portable, self-sufficient containers that can run on the cloud or on-premises. In a container-based approach, the host operating system’s kernel and resources are directly shared by the con

Sitecore Debugger

Image
After successful implementation of the Sitecore project, page performance comes into the picture in the context of page load time, slowness of page, or rendering. There are many tools available online to investigate the website performance like PageSpeed Insights, JMeter, GTmetrix, Lighthouse, etc., but Sitecore provides its own tool for troubleshooting the Sitecore performance issue i.e., Sitecore Debugger. “If you don’t have a fast website, users will bounce faster you can say. Google recommended page load time is under two seconds, However, speeding up your website is no easy task.”- Google This tool finds out the problems related to slow rendering, and pipeline time is taken and provides the other details for rendering like data source, parameter, Profile, cache setting, output, etc. The debugger facilitates developers to scrutinize the output of both the rendering and the entire page. So that developer can take care of page performance issues while

Contact Profile Image Using Avatar Facet in Sitecore

Image
Sitecore xConnect provides several default facets like personal information, AddressList, EmailAddressList, etc. Avatar is one of them and it comes under the IContactPicture Legacy facet. If you are new with Sitecore xDB and xConnect and need more insight on the Custom facet, How to create and set/update the facet then you can refer blog post Work with Custom Facet in Sitecore and Create Custom Facet in Sitecore. In this article, I am going to describe how to set the contact picture in the Avatar facet which we can see in the details tab in the experience profile window. private bool SetAvatarFacets(byte[] imageBytes, string mimeType, Contact contact, IXdbContext client) { var pictureData = imageBytes; var pictureMimeType = mimeType; var avatar = contact.GetFacet<Avatar>(Avatar.DefaultFacetKey); //Facet is null if (avatar == null) { avatar = new Avatar(pictureMimeType, pictureData);

Uninstall Sitecore Instance Manually

Image
In this blog, I will let you know how to completely remove the Sitecore instance from your machine manually. While installing the new instance we face the error regarding SQL Server, Sitecore Identity Server, etc. To overcome this situation, perform the below steps to entirely clean the old Sitecore instance and you can go with a smooth installation of the new instance. Stop the IIS and remove the configuration: Open the IIS server and in the right panel Action tab click on Stop. Again, in the left panel right-click on the Sitecore instance and choose the Remove option. In the left panel go to the application pool, select all respective Sitecore Instance application Pool and choose the remove option from the right panel. For example, in this blog, I am deleting the "sc1011sc.dev.local" instance. Delete Sitecore Service: Go to the Service window, Press the Win + R key, it will open the run windo

Lazy Loading in Glass Mapper

Image
Lazy loading is on-demand loading, when users request the content by Lazy loading then instead of loading the whole content on your page it loads only required content, till further request by users. Disable Lazy Loading in Glass Mapper: Individual Get-Item Method All Sitecore Service Methods Individual Get-Item Method: In Sitecore Service Method: var item = _service.GetItem<ICustomModel>("/sitecore/content/Home/Course", x=>x.LazyDisabled()); In MVC Context method: var item = _mvcContext.GetDataSourceItem<ICustomModel>(new GetKnownOptions { Lazy = Glass.Mapper.LazyLoading.Disabled}); All Sitecore Service Methods:  If you don't want to pass x.LazyDisabled() in all the GetItem methods then prefer the Generic Class approach. Create a Generic Class as below: public class RenderingRepository : IRenderingRepository { private readonly IMvcContext _mvcContext; public RenderingRepository(IMvcContext mvcContext)

Sitecore Technology MVP Journey 2022

Image
"Rome was not built in a day" , prominent idioms and one of my favorite quotes enthuse me a lot in life. It says, to achieve a long-term goal properly takes a long time and you should not hurry through for it. To get the badge of Sitecore MVP particularly in Technology for me is one of them. My journey for Sitecore MVP begins in the Year 2019. I commenced with Sitecore Technology blogs , actively participate on the Sitecore Stack Exchange Platform and Sitecore Slack Channel . I am honored to be named Sitecore Technology MVP 2022 . I feel fortunate to be participating with a Sitecore Community, Technology, and Product. I am happy that my all efforts and contributions are recognized by Sitecore and Community. My next focus for this year would be: Exploring more in Sitecore Project including Sitecore Content Hub, Docker, Headless, and Jam stack architecture Continuing with sharing and helping others into Sitecore Community.

Checkbox Rendering Parameter Taking Null Value If It's Unchecked

Image
Issue: I have a client requirement that each component should be flag-based to turn it on or off. I have used a checkbox in rendering parameters for the implementation of this functionality and applied that rendering parameter template on each component rendering. While reading these values, If I checked the Checkbox IsComponentVisiable it returns "1" and unchecked the Checkbox, it returns me null. var flag= RenderingContext.Current.Rendering.Parameters["IsComponentVisible"] I was surprised about its behaviour that instead of "0" it returns null? I raised the support ticket to Sitecore to understand that am I doing something wrong or if it's the default behaviour of the checkbox field when we use it as the rendering parameter? Sitecore suggested: Find below the Sitecore Team Response on my Ticket: Based on the provided information we would like to define the scope of the current case: Issue def

URL Redirects Module in Sitecore

Image
In one of my projects, my client's requirement was to implement the URL Redirect feature from his existing SharePoint website to the New Sitecore website. My client suggested the "Constellation.Feature.Redirects"  Redirect module to accomplish the functionality.  In this blog, I am giving insight on this module installation, what features I have used and the challenges I have faced during implementation. I want to give a huge thanks to Richard Cabral aka Sgt Sitecore who guide and helped me with the implementation. Installation: To install the URL redirect module please find below the link in which all the steps are mentioned in detail:  Constellation.Feature.Redirects Steps: Constellation.Feature.Redirects are managed via NuGet. In Visual Studio, fire up the Package Manager console and install it into a Web Application project: PM:> Install-Package Constellation.Feature.Redirects After installation, you must build an