Sightly | Community
Skip to main content
rk39193348
Level 4
Jun 20, 2017 5:03 PM UTC
Solved

Sightly

Hi,

I have to print parsys based on dialog selection. I cannot include parsys 15 times if I have 15 in dialog. How to print in loop in sightly? Suppose I have 15 in dialog i want 15 parsys in page. How can I achieve this?

Regards

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Feike_Visser1
Feike_Visser1Accepted solution
Employee
Jun 20, 2017 6:31 PM UTC

I would populate a Map with 15 items, and use that for the data-sly-list.

Example on Map here: htl-examples/HashMapExample.java at master · heervisscher/htl-examples · GitHub

6 replies

smacdonald2008
Level 10
Jun 20, 2017 6:57 PM UTC

It will poopulate the items in the MAP.

To learn how to work with HTL and repeating data sets -- see:

Scott's Digital Community: Creating an Adobe Experience Manager HTL component that displays a repeating data set

In this example - we are looping through a List where each element is an Object. However front end logic is very similar.

Translate
rk39193348
Level 4
Jun 20, 2017 6:53 PM UTC

Will it populate parsys 15 times?

Translate
smacdonald2008
Level 10
Jun 20, 2017 6:41 PM UTC

Thxs Feike!

Translate
Feike_Visser1
Feike_Visser1Accepted solution
Employee
Jun 20, 2017 6:31 PM UTC

I would populate a Map with 15 items, and use that for the data-sly-list.

Example on Map here: htl-examples/HashMapExample.java at master · heervisscher/htl-examples · GitHub

Translate
rk39193348
Level 4
Jun 20, 2017 5:24 PM UTC

Hi,

I want to include parsys in the page based on dialog selection. If 15 is selected in dialog I want 15 parsys in the page. How to call in loop in sightly?

Translate
smacdonald2008
Level 10
Jun 20, 2017 5:17 PM UTC

I am not clear at all on your requirements - what do you mean print parsys? A parsys is a component that lets you drop other components onto a page. A HTL component renders HTML.

Translate