This document discusses using Scriban templates in Sitecore Experience Accelerator (SXA) and customizing them. It covers using rendering variants in SXA, how Scriban adds flexibility to templates, and how to extend Scriban through context functions, item members, and custom objects. The speaker demonstrates how to build a custom object accessor to expose user profile properties in Scriban templates.
Inject Sitecore context – if needed
Process delegate : our custom logic “sc_meow” (use Func instead of delegate)
Config : resolve = true
Item member = extension method on “item”
Inject Sitecore context – if needed
- Membername
- Resolve function
Scriban objects – not related to Sitecore yet
Check is target is User
Get properties and return name..
Verify target.
Get the property named "member" from the UserProfile type.
Property is case sensitive!
Get the value of that property from the given object (User) - in our case it's the user.Profile and not the user itself.
This is SXA namespace
This is SXA namespace
sc_getusers = function to get users (or could be simple function to get the current User) return User object from that function
In order of likeliness to use them
Keep your templates simple !!!