Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to add individual parsys for each iteration ?

Avatar

Level 4

Hi Team,

I am working on a use case, but stuck at one point that i have created a multifield component where we can create multiple cards shown in the below image. But as soon as these cards are created it should also have individual parsys below it for each card. The parsys should get add dynamically for each card. and the content added into the parsys should be hide and show based on the click on that card. but Here i am not able to add the parsys itself. Please help here.

 

monish_gavali_0-1719345092052.png


My current HTL is

monish_gavali_1-1719345249906.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@monish_gavali 

Don't run a second loop. Include parsys in first loop before end of sly tag (i.e. before </sly>)

View solution in original post

4 Replies

Avatar

Level 3

hi @monish_gavali ,

Please try checking the Tabs component in AEM core component library which has similar implementation

 

reference : https://www.aemcomponents.dev/content/core-components-examples/library/core-content/tabs.html#tabs-9...

 

Thanks,

Anil

Avatar

Correct answer by
Community Advisor

@monish_gavali 

Don't run a second loop. Include parsys in first loop before end of sly tag (i.e. before </sly>)

Avatar

Level 7

The HTL looks OK. But can you check if the model is returning the expected value in xbrlCardDetails. And are you getting any errors in this ? 

Avatar

Community Advisor

Hi, 

Most likely the second time you loop your object this is empty because your HTL looks correct. My guess is that you are getting the xbrCardDetails values directly from an iterator, if that is your case, it is expected what you are seeing, and you can learn more here about it here: https://stackoverflow.com/questions/3831542/what-happens-if-you-call-the-same-iterator-twice-on-the-...



Hope this helps.



Esteban Bustamante