Skip to main content

Sitecore Experience Accelerator (SXA) – Why / Why Not?

So you have heard about Sitecore Experience Accelerator (SXA) and are debating if it is for you and your project.  First what is SXA and why should I be interested.  SXA is just what it sounds like.  Sitecore has built a framework on top of their Sitecore platform that adds some of the basic templates that allows you to focus on your value-add features faster.  What?!?  Let's take a look at this image to help explain.

SXA out of the box does a great job of separating the areas of concern when building your site that make logic sense.  With the User Experience driving your efforts, SXA allows you to have parallel work streams in the Back-End vs the Front-End vs the Visual Design.  To learn more visit the Sitecore SXA documentation at https://doc.sitecore.com/users/sxa/17/sitecore-experience-accelerator/en/introducing-sitecore-experience-accelerator.html.

With SXA you can:

  • Accelerate the delivery of sites using standard functionality with minimum-to-no CMS development.
  • Enable different work streams to run in parallel.
  • Assemble sites using responsive and reusable renderings.
  • Use themes to enable brand consistency.
  • Choose between different grid systems.

OK, But Do I Have to Refactor Everything to Use It?

The quick answer is no.  SXA is just a series of templates that you could use within your current implementation.  And there are some features you may find very useful quickly.  However, to take full advantage of the all the features which includes some of the tenant and site features, the true separation of concerns and some the Creative Exchange functions, you will find yourself considering the refactoring as a major reshift of your site.  

We chose to start a new 9.3 implementation from the ground up to take full advantage of all the features and to decouple us from our previous implementation based on an agency's custom framework.  We wanted a clean break away based on the issues we were dealing with on a daily basis.  While the initial undertaking was a little overwhelming, it was quickly replaced with the pleasure of having components that just worked.  Two of the best new features that drove our decision was (1) the separation of the Visual Layer.  This allowed us to include the CSS into the content tree.  Our marketing team likes to add new colors to the their palette and this required a full code push for a minimal change.  This was time consuming and prone to issues.  And (2), once we found and learned how to use Scriban template we were sold.  We will cover Scriban template in our next blog post but they are worth mentioning now.  This is by far the largest time saver we have found to date and very powerful.  Scriban is one of the hidden gems of 9.3 and you must be on 9.3 at a minimum.

But Should I Use SXA or JSS?  

There are a lot of opinions on this topic and they are varied across the board.  Let me explain why we chose SXA, but first lets share some opinions we found.


Tony Mamedbekov does a good job of explaining the differences on his blog but tends to lean towards JSS based on his experiences.  

Brian Graves has a solid blog entry that comes across a little more "fair and balanced".

And if you want something that is a little more fun you can watch the JSS v SXA Ultimate Showdown between Mark Van Aalst and Anastasiya Flynn.  It was shown at the Sitecore User Group Conference in April 2020.  I will let you make your own opinions on it.

Here is the quick and short on answer on one over the other.  Do you currently use, or plan to use, a JavaScript framework to build our your site?  Yes, then JSS is probably going to be best for you.  Do you have a lot of content and your concern is to get content loaded quickly and start seeing return on your investment?  Then SXA is probably a better option.  

Sitecore JavaScript Services (JSS) is billed by Sitecore as “a complete SDK for JavaScript developers that enables you to build full-fledged solutions using Sitecore and modern JavaScript UI libraries and frameworks.”
Sitecore Experience Accelerator (SXA) is a Sitecore accelerator that speeds up the production of websites and allows for the reuse of components, layouts, and templates across sites.
Our site relies on Data Exchange Framework (topic for another blog entry) to sync with an external system that provides a lot of our site content.  So based on our amount of content and our own personal biases we decided SXA was our best and fastest option forward.  We felt that JSS at this point required a lot of custom buildout.  Again, if you have the team and desire to go this way it is a great option on its own.  However, our goal was speed to market with a reduced team size so SXA provided our faster path forward.

Our final decision point came down to the Scriban templates that are new in v9.3 and used can be used by SXA.  This is one of the primary drivers of our speed to implementation.  We will cover this on our next blog.  

So, if you are already using JavaScript and are committed to that path then JSS will probably excite you more.  Our opinion is that users don't care what fancy framework you use to write your code and they all render HTML to the browser.  So we chose the SXA Framework for its base components and to assist with our speed to market.  There is no wrong answer here, it is based on what trade-offs you are willing to accept in your architecture.  

But here is a secret that may be new to some.  You can use both in the same implementation.  What!?!  Yes you can use SXA on parts of the site and then use JSS to build out custom functionality when you really want to dazzle the experience.  It's up to you and your project and "it depends".

So, until next time.

Comments

Popular posts from this blog

Quick Tip - Scriban Date Formatting in Sitecore

 With the Scriban syntax being new to the Sitecore platform with v9.3 there is definitely a learning curve but well worth the time investment.  So we will post short tips on things that we struggled with.  This is to share but also I will have a place to find it again when I need it. So you've created a date field in your Sitecore template and now need to format it for display purposes.  Or even better, you have styling differences depending on if the dates and years match for start and end points.  Let's show this below. First, get the date(s) in your Scriban template from the item.  In this scenario I was looping through child objects called i_child.  Using the Scriban date.parse function I can get the date value from the Sitecore field by this:     {{         this.startDate = sc_field i_child 'Event Start' | date.parse;         this.endDate = sc_field i_child 'Event End' | date.parse;     }} Now that we have the date values you can do things to check against

Sitecore Scriban Templates – Custom Functions to the Recue

 So you jumped in head first into Scriban Templates with Sitecore.  And now you hit a wall because it doesn't do that one thing you could easily have completed in MVC forms with a controller.  Well, this is where you can build your own custom functions to work within Scriban templates.  Sitecore already provides a few of these at  https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/the-embedded-functions-for-the-scriban-template.html . So How Do You Build Your Own? Well let's begin by discussing what we want to build.  In our project we have a need to get the nearest parent of a certain template type.  This way we can determine if the page you are viewing is part of a conference section or not.   So first, let's build the C# code that will execute when we call the function.  We decided to add a new member to the i_item to determine if we were in a conference context and allow us to call other properties as we would need. public class GetConferenceC

Sitecore 9.3 – Scriban Templates – Yes Please!

 This feature sold us on our migration to Sitecore v9.3 and using SXA.  Why was it so important in our decision?  Based purely on speed to implement.  Let's explain, but first what is Scriban? What is a Scriban Template in Sitecore? Scriban is a fast, powerful, safe and lightweight scripting language and engine for .NET, which was primarily developed for text templating with a compatibility mode for parsing liquid templates. And Sitecore SXA has has adopted this new templating system whole-heartedly.  It allows a lot of your custom HTML and MVC controls to brought into the content tree.  Why is this important?  Because now you don't have to create a custom controller and CSHTML to create a rendering.  You can create and use a Scriban template. For more information refer to the documentation found at  https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/scriban-templates.html .  You can also find more documentation on the Scriban template itself at  htt