Skip to main content
Oct 16, 2015 2:28 AM UTC
Solved

Sightly how to get multivalued properties

Hi,

I am new to Sightly world and i can't find the way to retrieve the values from mutlivalued string with a multifield.

<ul data-sly-list.child="${properties.items}"> // Doing this the iteration definitely happens.
    <li>Child Item: ${properties.heading}</li> // This prints both the keys together.

OR <li> Child Item: <li>Child Item: ${child.heading}</li> //Dosen't Print anything. Neither childList does.

</ul>

 // items the key of the element which is stored like below

      
items
String[]
{"heading":"sdf","label1":"sdf","./label2":"sdf","label3":"sdf"}{"heading":"sdf","label1":"sdf","./label2":"sdfsd","label3":"sdfsdf"}

Any help is appreciated. It can't be complex but nowhere in the documentation anything is mentioned about properties. They all have listed page iteration example.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

IMO It is covered at [1].  With just theoritical knowledge of [1] something like  [2] should work.  Give a try

[1]  http://docs.adobe.com/content/docs/en/aem/6-0/develop/sightly.html

[2]

<dl data-sly-list.head="${properties.heading}">
    <dt>key: ${head}</dt>
    <dd>value: ${properties.heading[head]}</dd>
</dl>

5 replies

Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

IMO It is covered at [1].  With just theoritical knowledge of [1] something like  [2] should work.  Give a try

[1]  http://docs.adobe.com/content/docs/en/aem/6-0/develop/sightly.html

[2]

<dl data-sly-list.head="${properties.heading}">
    <dt>key: ${head}</dt>
    <dd>value: ${properties.heading[head]}</dd>
</dl>
Translate
Level 3
Dec 14, 2016 7:02 AM UTC

Hi Sham,

How do we get the properties from which the multifield data saved as nodes?

Thanks,

Sony

Translate
Feike_Visser1
Adobe Employee
Adobe Employee
Dec 15, 2016 9:56 AM UTC

what do you mean with "saved as nodes"

Translate
soumyad3
Jul 25, 2019 3:25 PM UTC

hi Feike,

I have a multifield having two textfields, but when I add the data to the multifield, it is saving as nodes.

Below the screenshot for that :

Can you please help me getting the values from this nodes using data-sly-list or data-sly-repeat.

Thanks

Soumya Dutta

Translate
arunpatidar
Community Advisor
Community Advisor
Jul 25, 2019 4:04 PM UTC

Hi Somya

you need to write a sling mode or wcmusepojo class to achieve this.

You can't do it alone with sightly.

AEM 6.3 Code snippets : Coral 3 multifield component - Keys and Strokes

Translate
Arun Patidar