Questions tagged [scriban]
For questions related to the SXA Scriban templates.
61 questions
0
votes
1
answer
1k
views
Where can I find Scriban training or examples?
I'm trying to learn the basics of how to use Scriban to customize Sitecore SXA components. I'm having trouble finding any complete walk-throughs or training that provides a full example start to ...
1
vote
1
answer
1k
views
Sitecore scriban how to fetch linked item from it's linked sub item?
I have a requirement to fetch the linked item from its linked sub item along with some linked item from the parent item's field. Below is the scenario.
I have a "Landing Page"
In the "...
0
votes
1
answer
307
views
Re-use the scriban template
Is there a way we can reuse a scriban template? I have a PromoBlock scriban template and I need to re-use that in the PromoHero and apply the Css Class to make it behave differently
This is the ...
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 }}
2
votes
1
answer
1k
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
1
answer
375
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 { ...
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
1
answer
2k
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 ...
1
vote
0
answers
227
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?
2
votes
1
answer
592
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:
...
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 ...