Questions tagged [scriban]
For questions related to the SXA Scriban templates.
7 questions
2
votes
1
answer
2k
views
How do you count the number of children in a Scriban template?
Given a page or item, how do I count the number of children?
{{ i_page.children }}
1
vote
1
answer
5k
views
Null checks in Scriban
I want to check for null values in Scriban.
{{ if (o_model.address.id) }}
<div style="text-align: center;"><h5>Address {{ o_model.address.id}}</h5><br /></div>
...
5
votes
2
answers
6k
views
Accessing Link Field Values in a Scriban Template
I am using a Scriban template in Sitecore 9.3 with SXA and am attempting to render a link field. While the sc_link function reliably generates the URL, I cannot seem to find a way to access any other ...
2
votes
1
answer
2k
views
Is there a way to get a user object in Scriban?
I was trying to display user information inside a Scriban template (SXA variant).
I managed to write a context function that gives me the full name of the user (or any profile property I put in ...
2
votes
1
answer
266
views
Object reference not set to instance in preview mode for sc_translate
I am getting object reference not set to instance at sc_translate in preview mode
When i checked the scriban loc (10,57), it is sc_translate
What can be the possible reason for this?
2
votes
2
answers
2k
views
Get Item by path or ID using Scriban in Sitecore
Environment: Sitecore 10.2 & SXA 10.2
Scenario: I would like to get the item by using its path or ID in Scriban.
Is there any OOTB functionality to achieve this?
1
vote
1
answer
1k
views
Is there a way to render scriban templates without the use of SXA Rendering Variants?
I would like to do some quick prototyping of scriban templates but have found constantly changing the rendering variant and refresh the page to be more time consuming than I would like.
Is there a ...