Hi,
I need to loop according to given Integer input.
Eg - According to user input, i need to repeat to print some HTML elements.
if user input is 1,
<div> 1 <div>
if user input is 2
<div> 1 <div>
<div> 2 <div>
How can i achieve this from HTL.
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
HTL does not support traditional looping, arithmetic operations.
you have to create a list from user input inside the sling Model as suggested by
Create an Integer List in the Sling Model based on the user input value. Fetch the list in HTL and loop over it.
You can use sly-list or sly-repeat base on requirement.
HTL does not support traditional looping, arithmetic operations.
you have to create a list from user input inside the sling Model as suggested by
Views
Likes
Replies