Extending / Altering OOTB SXA Components

Reading Time: 2 minutes

Sitecore is great platform. You have various options how to solve certain requirements. SXA extends this platform with a lot of functionality and nice concepts like Page & Partial Designs, Toolbox, Creative Live Exchange. Of course you have also broad range of components in the package when you install SXA.

You have various options how to extend or change/alter behavior of OOTB SXA components:

 

1. Rendering Variants

+ Easiest way to alter generated HTML for component fields (just add Rendering Variant on existing component)

+ Great for quick prototyping

– HTML defined in View cannot be changed

– Harder to maintain for different sites other than where Rendering Variant was create in (you shouldn’t alter OOTB branch templates therefore you cannot add your variant to branch template of SXA component and add it during site provisioning for other sites)

TIP: More details about Rendering Variants can be found in official SXA documentation.

 

2. Custom Views

+ Easiest way to alter generated HTML in OOTB View for SXA components

+ Custom views can be either site or tenant specific so custom views can differ also between sites

+ Easy to set and maintain in your solution

– Rendering Variants for component cannot be changed

– Changes in Custom View cannot be “significant” as they need to be compatible with existing Rendering Variants or Controller functionality

TIP: More details about Custom Views can be found in my detailed blog post.

 

3. Cloning Components

+ Component can be named better to follow “domain / business language”

+ Complete control of what Rendering Variants are defined for component

+ Complete control of what HTML is generated from View (if you choose to copy the View during cloning)

Golden Hammer when you need to do small changes or amendments to SXA OOTB components

TIP: More details about Cloning Components can be found in my detailed blog post or in official SXA documentation.

 

I believe there are also other options that you know about. Comment this post to spread the knowledge 🙂 Thanks.

Successful SXA journey to you!

2 comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.