top of page
  • Heena Shirke

How to iterate Multifield simply using HTL

Let's refer Multifield we created here, which has following fields:

Following HTML uses Sling Model to access multifield values:

<section 
data-sly-use.props="com.aemblog.core.models.MultifieldExampleSlingModel">
    <div data-sly-list.multifielditem="${props.multifieldList}">
           <p>Title: ${multifielditem.name}</p>
           <p>URL: ${multifielditem.url}</p>
    </div>
</section>

Following HTML uses Global Object resource to access multifield values:

<section 
data-sly-list.props="${resource.getChildren}">
    <div data-sly-test="${props.name == 'multifieldList'}"
    data-sly-list.multifielditem="${props.getChildren}">
           <p>Title: ${multifielditem.name}</p>
           <p>URL: ${multifielditem.url}</p>
    </div>
</section>

Using HTL for accessing Multifield values comes handy when no custom processing is required on dialog values.


2 views

Recent Posts

See All
bottom of page