September 24, 2026

HTL data-sly-use: Initializing Java and JavaScript Objects

HTL sly-use

data-sly-use initializes a Java class or a JavaScript object. Parameters can be passed to the initialization using options.

Java

<div data-sly-use.nav="org.company.Navigation">${nav.foo}</div>

JavaScript

<div data-sly-use.nav="navigation.js">${nav.foo}</div>

See the Use-API for a full example with parameters.

Back to the HTL tutorial index