September 24, 2026

HTL data-sly-unwrap: Removing the Host Element

HTL sly-unwrap

data-sly-unwrap removes the host element from the generated markup and keeps its content.

<p data-sly-use.sort="sorting.js" data-sly-unwrap>Sort Text</p>

The output contains Sort Text without the surrounding <p>. This is useful when an element is needed only to carry another block statement, such as data-sly-use.

Back to the HTL tutorial index