Can someone please tell me what this expression means (ie the !< as opposed to >)
{{!< default}}
Does it mean that the default partial is called unless that default has an override? And what could over-ride it, is it code injection?
Can someone please tell me what this expression means (ie the !< as opposed to >)
{{!< default}}
Does it mean that the default partial is called unless that default has an override? And what could over-ride it, is it code injection?
{{!< ..}}
is the layout directive which is not part of “official” handlebars. Your example tells the renderer to render this file (e.g. index.hbs
), and place the contents into the {{{body}}}
block of default.hbs
e.g.
/* default.hbs */
a
b
{{{body}}}
c
/* index.hbs */
This is some text!
When index.hbs
is rendered, the output will be
a
b
This is some text!
c
What is a, b and c?
Example content to prove the point of how injection works for partials.
Thanks Vikas…you guessed the context right, it is the index.hbs file of the world-famous Krabi theme, which is simply this:
{{!< default}}
{{> loop }}
{{ pagination }}
It wasn’t intuitive what {{!< default}} was doing, so thanks