Sightly - List of Parsys | Community
Skip to main content
b7wilso
Level 3
October 16, 2015
Solved

Sightly - List of Parsys

  • October 16, 2015
  • 5 replies
  • 2980 views

I have a case where I need to create a variable number of parsys in a Sightly component.  Here's the code I am currently trying:

<div data-sly-list="${var.List}"> <div class="${item}"> <div data-sly-resource="${'field' + itemList.count @ resourceType='wcm/foundation/components/parsys'}"> </div> </div> </div>

which is dying because it cannot parse the "+ itemList.count".  If I take that part off, it only shows one of the two (or three) parsys as editable, but if I add a component to that parsys it will show up the number of times selected.  Any ideas how to separate these parsys from each other?  I would prefer to do it as part of a list, but could be persuaded otherwise if someone provided a good enough solution.

Thanks in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1
  1. Can you try this?
  2.  
  3. <div data-sly-list="${var.List}">
  4. <div class="${item}" data-sly-test.resourcePath="${ '{0}{1}' @ format=['field',itemList.count]}">
  5. <div data-sly-resource="${ resourcePath @ resourceType='wcm/foundation/components/parsys'}">
  6. </div>
  7. </div>
  8. </div>

5 replies

b7wilso
b7wilsoAuthor
Level 3
October 16, 2015

@Fieke - that worked perfectly.  Thank you for your help!

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015
  1. Can you try this?
  2.  
  3. <div data-sly-list="${var.List}">
  4. <div class="${item}" data-sly-test.resourcePath="${ '{0}{1}' @ format=['field',itemList.count]}">
  5. <div data-sly-resource="${ resourcePath @ resourceType='wcm/foundation/components/parsys'}">
  6. </div>
  7. </div>
  8. </div>
May 30, 2023

I added carousel component and I need to add 5 Image component I added, but I need show 3 Images, but when I add Image inside carousel It's showing only one. How I can show 3 images @smacdonald2008 @alvawb 

Community Manager
October 16, 2015

Hi b7wilso,

This document http://docs.adobe.com/docs/en/aem/6-0/develop/sightly.html#Expression Options should help.

Regards,

Alva

b7wilso
b7wilsoAuthor
Level 3
October 16, 2015

@smacdonald2008 - Do you have an example?  I have done several google searches and not finding any examples of this syntax.

smacdonald2008
Level 10
October 16, 2015

Our eng team said that + operation is not supported in sightly. Use @format instead.