Last active
February 1, 2024 18:09
-
-
Save kevinweber/4aa2317286de43b7ba6f0714262c481a to your computer and use it in GitHub Desktop.
AEM/HTL: Define a list/array within a HTL template (and avoid redundant code!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--/* 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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
thanks for the example