September 24, 2026

HTL data-sly-element: Changing the Element Name

HTL sly-element

data-sly-element replaces the element name of the host element.

<h6 data-sly-element="${headerLevel}">Title Text</h6>

This replaces h6 with the value of headerLevel. If headerLevel returns h1, the element is rendered as <h1>.

Back to the HTL tutorial index