So I have the code below (which I got from Sightly how to get multivalued properties )
<dl data-sly-list.head="${properties.testimonials}">
<dt>key: ${head}</dt>
</dl>
and this gives me
<dl data-sly-list.head="${properties.testimonials}">
<dt>key: ${head[testimonialPath]}</dt>
</dl>
And my page won't load because of an error. I then tried
<dl data-sly-list.head="${properties.testimonials}">
<dt>key: ${head["testimonialPath"]}</dt>
</dl>
and while there's no error, I also doesn't display the value.
Can you please help? Thanks!
Solved! Go to Solution.
If you want to return only values that start with /content - i recommend using Java business logic to filter the ArrayList and then display those values.
See this article where we work with Collections and HTL. The Java part of the HTL returns a Java collection and the HTL iterates over it and renders the values:
<div data-sly-test="${ibeanObj.lBean}" data-sly-list.items="${ibeanObj.lBean}">
<div style="height:250px;"><img src=${items.path} height=200 width=270 style="padding:4px"/><h2>${items.page}</h2>
<p>${items.desc}</p>
</div>
<hr>
</div>
If you want to return only values that start with /content - i recommend using Java business logic to filter the ArrayList and then display those values.