Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Anudeep_Garnepudi
Anudeep_GarnepudiAccepted solution
Community Advisor
Apr 27, 2021 8:43 AM UTC

@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>
AG

3 replies

Asutosh_Jena_
Community Advisor
Community Advisor
Apr 21, 2021 9:30 AM UTC

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!

Translate
Anudeep_Garnepudi
Community Advisor
Anudeep_GarnepudiCommunity AdvisorAccepted solution
Community Advisor
Apr 27, 2021 8:43 AM UTC

@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>
Translate
AG
Adobe Employee
Apr 29, 2021 6:49 AM UTC
Thank you, was very helpful
Translate