Skip to main content

Contextual rendering

Contextual rendering uses the {{render}} helper to specify a default template for a given context.

showLineNumbers
1
{{render this [/core/promo/Promo.hbs]="/core/promo/FancyPromo.hbs"}}

In the above scenario FancyPromo.hbs must be registered as a style variation (see Style variations) in a _config file:

showLineNumbers
1
{
2
"styles": {
3
"/core/promo/Promo.hbs": {
4
"templates": [
5
{
6
"displayName": "Fancy Promo",
7
"example": "/core/promo/FancyPromo.json"
8
}
9
]
10
}
11
}
12
}

Editors can override the default template for a given context.