Hi All,
Reffered to a post written by Feike Visser http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage... and am making use of the same javascript function.
In my html[AEM 6.2], using the below snippet :
<sly data-sly-use.itemCount="itemCount.js" data-sly-unwrap />
<ul data-sly-list="${itemCount}">
<div data-sly-resource="${ 'par' @ resourceType='foundation/components/parsys'}"></div>
</ul>
#1] Tried various combinations to the line "<div data-sly-resource="${ 'par' @ resourceType='foundation/components/parsys'}"></div>", but no luck.
Even though the loping is happening fine for this column control component[which we are working on], say looping is happening 5 times, the parsys appears only once in one of the column and not 5[which is expected].
Not sure why is this not working.
Any thoughts here would be helpful
Solved! Go to Solution.
what if you use @ format, to have different parsys? So you have par0. par1 etc.
<ul data-sly-list="${itemCount}">
<sly data-sly-test.parResource="${ 'par{0}' @ format[itemList.index}"/>
<div data-sly-resource="${ parResource @ resourceType='foundation/components/parsys'}"></div>
</ul>
But you have then 5 times the same parsys?
<div data-sly-resource="${ 'par' @ resourceType='foundation/components/parsys'}"></div>
Why do you want to loop and add parsys - typically when you loop in HTL- you are adding content from a bean or Java collection. I am not sure why you want this?
For example --
https://helpx.adobe.com/experience-manager/using/htl_repeat.html
Notice each loop - we are writing out the contents of a LIST object that renders the content to a web page. You should write out content - not a parsys.
Views
Replies
Total Likes
Hi Scott/Feike,
Thank you for your reply. Basically, we need to create a column control component, wherein there is no limit on the number of columns that can be present[this is a client requirement.]
I am trying to convert the jsp code in this forum post[https://forums.adobe.com/thread/1014789] to sightly and this is where I am facing this issue.
If I try directly with the jsp code, it seems to be working.
Any thoughts/reference code will e really helpful.
Views
Replies
Total Likes
I will search for this - all the examples I have ever done/seen - we are writing out data via HTL as opposed to a parsys.
Views
Replies
Total Likes
what if you use @ format, to have different parsys? So you have par0. par1 etc.
<ul data-sly-list="${itemCount}">
<sly data-sly-test.parResource="${ 'par{0}' @ format[itemList.index}"/>
<div data-sly-resource="${ parResource @ resourceType='foundation/components/parsys'}"></div>
</ul>
Hi Feike,
Thank you for your reply.
Will check on this and keep you posted on the outcome.
Views
Replies
Total Likes
Hi Feike,
Thanks a ton for your reply.
It works now.
Views
Replies
Total Likes
Great! Thanks for the feedback!
Views
Replies
Total Likes
i need parsys for Accordion component. I need parsys in loop as how many times I have added multifield. Is there any option to repeat parsys?
Views
Replies
Total Likes
Views
Like
Replies