September 24, 2026

HTL data-sly-text: Replacing Element Content

HTL sly-text

data-sly-text replaces the content of its host element with the specified text.

<div data-sly-text="${currentPage.title}">My page title</div>

This prints the current page's title. The placeholder text is still useful: you can search for "My page title" in the HTML source to find the component.

Back to the HTL tutorial index