Tuesday 18 August 2020

Debugging Sitecore Commerce SDK

Sitecore Commerce Engine is a light weight .Net Core application which is extended with plenty of other plugins (Pricing, Carts, Promotions, Search etc.), which in turn are other independent .Net Core projects, to make an Experience Commerce solution.

Sitecore provides an SDK which can be used as a starting point for customizing the commerce solution. You can use this SDK to extend the commerce solution either by adding new plugins or extending the existing plugins.

Debugging the .Net Core applications are slightly different. To make .Net Core applications run across multiple platforms like Windows, Linux, Unix etc. it uses Kestrel web server. Kestrel web server is by default specified in ASP.Net Core project templates and Sitecore Commerce Engine is no exception. 

Wednesday 12 August 2020

SPEAK 2.0 Part 4 - Structures

SPEAK Structure rendering creates a structure/layout for the SPEAK applications.

There are mainly four types of Structure renderings,

  1. DashboardPageStructure
  2. ListPageStructure
  3. TaskPageStructure
  4. DialogPageStructure

NOTE: There are 3 more Lagecy Structures available in Sitecore 9.3. These structures might get removed in next versions of Sitecore.

  • LagecyDashboardPageStructure
  • LagecyListPageStructure 
  • LagecyTaskPageStructure

Wednesday 5 August 2020

SPEAK 2.0 Part 3 - PageCode

For any SPEAK application, PageCode is the required component. PageCode initializes the SPEAK application.

PageCode serves two purposes,
  • It allows you to write business logic for your SPEAK application.
  • Sets which SPEAK version to use to render the applications.
NOTE: There are two versions available as of now. SPEAK 1.1 and SPEAK 2.0. We will be using SPEAK 2.0 in our examples

You can write business logic for your SPEAK application using PageCode component. You can do it in two ways.
  • Javascript PageCode

    • Javascript business logic is easy to maintain over time and makes application more responsive
    • Prefer this approach if you don't have security constraint over business logic
  • C# PageCode

    • Sitecore gives you provision to write C# code also for writing business logic for your SPEAK application

Monday 3 August 2020

SPEAK 2.0 Part 2 - Page Layouts

Sitecore provides three layouts to create SPEAK applications. You can find these layouts in core database at this location  /sitecore/client/Speak/Layouts/Layouts

NOTE: All examples and screenshots are taken from Sitecore 9.3 initial release



SPEAK 2.0 Part 1 - Introduction

Greetings Reader!!

This is the first blog in the SPEAK 2.0 series. In this blog, we will understand what is SPEAK, what it is built with and what it offers to Sitecore developers.

What is SPEAK?

SPEAK is an acronym for "Sitecore Process Enablement and Accelerator Kit". Sitecore provides a library of SPEAK compatible components, visual layouts, and styles that developers need in order to implement applications.

SPEAK uses latest browsers standards and HTML5, CSS3 and Javascript libraries like Require JS to build the interface for the controls

Friday 30 June 2017

GetItem method returns null when Item Name is like GUID

Recently, we upgraded our CMS to Sitecore XP 8.2 Initial Release, we started facing weird issue. The fonts where not loading on pages. When we started digging the issue, we found a pattern. The issue was not for all font files but only for those having GUID like names

E.g. 054c9659-429a-4553-b54e-7db2eedb542a.woff2

So, we tried to reproduce and debug the same in local and we came to know that while trying to get item by using GetItem(string path) method, it returns null.

Then we tried to replicate the same in clean sitecore installation. We created an Item under /sitecore/content/Home/ and named it 054c9659-429a-4553-b54e-7db2eedb542a

Thursday 22 June 2017

Sitecore Cache Manager Tool


Sitecore provides very powerful caching mechanism. Mainly there are three types of cache layers, Items cache, Data cache and Prefetch cache.

Other than above caches, there are many other different caches sitecore maintains in memory. And the number dramatically increases if you have multisite instances.

Read more about sitecore caches in detail: http://sitecoreblog.patelyogesh.in/2013/06/how-sitecore-caching-work.html

Caching issues on CD servers after publishing is common when you are dealing with horizontally scaled Sitecore environment and we were no exception. Recently, we started facing this issue frequently.

Meanwhile you are troubleshooting the caching issue as it might not be a task of a day or two - sometimes you may have to wait for weeks for it to reproduce and collect all relevant data - Cache Manager tool is must have tool for all Sitecore developers dealing with large instances.

Sitecore provides a nice caching tool, Cache.aspx,  in built. (you may find it at /sitecore/admin/cache.aspx) this tool is helpful when you are dealing with small instances of sitecore where your entire cache size is not more than 500 MB, because this tool has a button to clear ALL the caches on a single hit.