Element

Element

{% element %} (block)

Outputs a block-level HTML element with nested content and sanitized attributes.

{% element / %} (self-closing)

Outputs a sanitized HTML element that is self-closed.

Examples

Output self-closing input element

Copy
{% element 'input' type:'text' name:'username' placeholder:'Username' required:required / %}

Output content inside div

Copy
{% element 'div' id:'maincontent' class:'container wide' %} {% include '/maincontent' %} {% endelement %}