Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Surajkamdi/c6185ee1e385cc4e139f2a61a2577cc9 to your computer and use it in GitHub Desktop.
Save Surajkamdi/c6185ee1e385cc4e139f2a61a2577cc9 to your computer and use it in GitHub Desktop.
AEM/HTL: Define a list/array within a HTL template (and avoid redundant code!)
<!--/* We can define a list within a Sightly template to avoid redundant code */-->
<sly data-sly-test.versions="${['desktop', 'mobile']}"/>
<sly data-sly-list.identifier="${versions}">
<div class="element ${identifier}">Repeated content</div>
</sly>
<div class="element desktop">Repeated content</div>
<div class="element mobile">Repeated content</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment