September 24, 2026

HTL data-sly-attribute: Adding Attributes to Elements

HTL sly-attribute

data-sly-attribute adds attributes to the host element.

<div title="Page Title" data-sly-attribute.title="${properties.jcr:title}"></div>

This sets the title attribute to the current page's title. The placeholder value is still useful: you can search for "Page Title" in the HTML source.

Back to the HTL tutorial index