One or more tags that represent case-sensitive tag names that will invoke this extension.
Private getGets the template content for the specified type with fallback logic.
Private preparePrivate renderRenders the embedded template content with the provided data context.
Private resolveResolves the content type to use for the embedded template. Priority order:
Executes the template embedding logic with recursive template inclusion.
Parameter Mapping from CallExtensionAsync:
new nodes.CallExtensionAsync(this, 'run', params)run(context, body, callBack)The body parameter will be undefined since TemplateEmbed is a self-closing tag
that doesn't parse body content. The template name and configuration come from
the parsed parameters instead.
Nunjucks template rendering context containing variables and data
Will be undefined for self-closing template tags (not used)
Async callback function to return results or errors
{% template "HeaderTemplate" %}
{% template "UserCard", type="HTML" %}
{% template "Footer", data={year: 2024} %}
Extension that enables recursive template embedding using {% template "TemplateName" %} syntax.
Features:
Usage: {% template "TemplateName" %} {% template "TemplateName", type="HTML" %} {% template "TemplateName", data={extra: "value"} %} {% template "TemplateName", type="PlainText", data={key: "value"} %}