Hi All,
We have a requirement to append the banner dimensions in an array format to generate the script encoded in HTL .Here in the script , the size mapping should be formed from the input given in the multi field item.
sizeMapping: [
[[x, y], [[a, b], [e, f]]],
[[z ,x], [a, b]],
[[y, z], [[e, f], [c, d]]],
],
sizes: [
[a, b],
[e, f],
[c, d],
],
[x, y],[z ,x],[y, z]-Breakpoint (first multi field values)
[a, b], [e, f],[c, d]-BannerSizeDimensions(nested multi field values)
So , size mapping should be formed in the combination of single breakpoint(highlighted) and multiple banner size dimensions as above in the array format .Also ,sizes should be formed from the unique values present in the banner size dimensions input as above.Could you please help me on how to achieve this array formatting in the script through sling model/HTL.
Thanks in Advance!
Solved! Go to Solution.
Views
Replies
Total Likes
@Keerthi97 Welcome to communities, Are you not using Sling models to support your component. It should be fairly simple to achieve/code all your business logic in sling model and use HTL to support your UI or html or script generation.
@Keerthi97 Welcome to communities, Are you not using Sling models to support your component. It should be fairly simple to achieve/code all your business logic in sling model and use HTL to support your UI or html or script generation.
Hi @Shashi_Mulugu ,
Thanks for your response .
Can you please share any code reference to achieve the above array formatting from sling model .
Thanks.
Views
Replies
Total Likes