Questions tagged [scriban]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
42 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
1answer
43 views

How to get Media URL with custom width and media protection hash using Scriban

I need separate image fields for mobile and desktop and trying to render it using Scriban in picture tag as below. Current Scriban code: <picture> <source srcset="{{ i_item....
0
votes
1answer
31 views

DisableWebEdit in a Scriban template

Is there a way we can use DisableWebEdit=true in a Scriban template?. Like on a cshtml page we can use <title>@Html.Sitecore().Field("Title", Sitecore.Context.Item, new { ...
0
votes
1answer
134 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> ...
2
votes
1answer
121 views

Using Model in Scriban template

Is it possible to use the current Model in Scriban? I have a CutomHeroViewModel public class CustomHeroViewModel : VariantsRenderingModel { public string HeroTitle { get; set; } public string ...
0
votes
0answers
55 views

Is there a way to access all of a page's components?

I want to create a custom scriban Processor and I need to access all of the renderings that have been put on the page. Is there a way to access that data?
1
vote
1answer
85 views

Customize Link rendering variant to append query string parameters

I want to customize an SXA link component with a rendering variant that appends query string parameters to the link based on fields on the page item. I'm using a Scriban template something like this: ...
3
votes
2answers
528 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
1answer
237 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 ...
3
votes
1answer
325 views

How can I use Sitecore Rules in Scriban templates in SXA 9.3

In SXA 9.3 we have the possibility of using Scriban Templates. I wonder if there is a possibility to use Sitecore rules engine inside of those templates. Let say that I would like to render part of ...