rk39193348
25-01-2017
Hi,I am using the below code to print list children items on page, but it's not working. Can anyone please suggest how to achieve this?
<ul data-sly-list.child="${currentPage.listChildren}">
entering <li>${child.title}</li></ul>
Regards
huzaifaha985211
26-01-2017
One way to do it is to use a bundled Java Class where you can put your logic and then return the result you want into your componentName.html. Here is an example from https://docs.adobe.com/docs/en/htl/docs/use-api/java.html
package
org.example.app.components;
import
com.adobe.cq.sightly.WCMUse;
public
class
Info
extends
WCMUse {
...
}
Code samples are intended for illustration purposes only.
and, the data-sly-use statement must reference the fully qualified class name, as opposed to just the local class name:
<
div
data-sly-use.info
=
"org.example.app.components.info.Info"
>
h1
>${info.title}</
p
>${info.description}</
</