Thursday 20 February 2020

Sitecore SXA Scriban

I have been working on a new Sitecore 9.3 implementation with Sitecore Experience Accelerator (SXA) 9.3 recently and I got chance to work with some interesting new stuff that I would like to share with you in a couple of blog posts, I expect you will find these very useful and fun, SXA 9.3 came with a lot of new features and enactments, one of these new features is using Scriban Templateting in rendering variants, so, in this post will give an introduction of what is a rendering variant? and what is Scriban? and on the next posts will show you how we can build a custom extensions for Scriban.



What is Scriban?

Scriban is a fast, powerful, safe and lightweight text templateing language and engine for .NET, with a compatibility mode for parsing liquid templates.

A template language providers placeholders which can be replaced later, in addition to provide the ability to create conditions and loops, there are many examples of template languages like Handlebar, Fluid, Stubble....etc.


What is SXA Rendering Variant? 

As you probably know, Sitecore XA comes with a OOTB renderings in addition to a predefined variants for some renderings, rendering variants is a way for developers or designers to have more power over how to display or present content, with a simple couple of steps you can create a different look and feel of an existing rendering, what a flexibility!  If you want to know more of how you can create a rendering variant, click here

With Sitecore 9.3 you can now use Scriban template ti have your full HTML structure instead of defining individuals fields elements, this way a front end developer can have the ability to use Creative Live Exchange to export these variant and update the html and import back. WoW!


Why Scriban? 

A fair question one could ask, there are a lot of templateing languages, why Sitecore uses/updated to use Scriban? 

Sitecore SXA team did investigate different templateing languages and based on the perfroamnce result they found that Scriban is on of the fastest, following is a screenshot from that study:


Hope the above gave a quick introduction of Scriban, in the next couple of posts will show some of the custom Scriabn extensions I needed and how you can update the search results rendering html as example of using Scriban. stay around! 

1 comment:

sri said...

Thanks for sharing this informative content , Great work
Leanpitch provides online training in Enterprise agile coaching during this lockdown period everyone can use it wisely.
Enterprise agile coaching

Post a Comment