Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Creating Dropdown in multifield using Sightly

Avatar

Avatar
Level 1
Keerthana_H_N
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
Keerthana_H_N
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
Keerthana_H_N
Level 1

21-04-2021

Hi, I'm trying create a drop using multifield values. Does anyone know the sightly code for this? 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

271 likes

Total Posts

320 posts

Correct Reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

271 likes

Total Posts

320 posts

Correct Reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

27-04-2021

@Keerthana_H_N 

I guess you want to show the multifield items in a dropdown(select).

I have a nested multifield with name options. Multifield has textfield name ./option

Below is HTL to render multifield items as select.

<sly data-sly-list.children="${resource.getChildren}">
    <sly data-sly-test="${children.name == 'options'}">
        <select data-sly-list="${children.getChildren}">
            <option>${item.option}</option>
        </select>
    </sly>
</sly>

Answers (1)

Answers (1)

Avatar

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

373 likes

Total Posts

480 posts

Correct Reply

133 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

373 likes

Total Posts

480 posts

Correct Reply

133 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile
asutosh_jena
Level 10

21-04-2021

Hi @Keerthana_H_N 

 

If I understand the requirement correctly, you have the multifield in your component dialog and have authored the values in it. Now you want to read those values and populate in HTML as a dropdown by iterating over HTL?

 

Thanks!