Solved
Child Pages Not Showing
I'm trying to fetch the child pages when I enter the path in the link. But it's not working
Below is the java code:
@Model(adaptables = Resource.class,defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class Test {
@ValueMapValue
private String filePath;
@OSGiService
private ResourceResolver resourceResolver;
@Inject
Resource items;
public Resource getItems() {
Resource resource=resourceResolver.getResource("/content/second/us/en/jcr:content/root/container/container/testone");
filePath=resource.getValueMap().get("filePath",String.class);
items= resourceResolver.getResource(filePath);
return items;
}
}
Below is the html code:
<sly data-sly-use.model="com.secondsite.core.models.Test"></sly>
<pre data-sly-test="${properties.linkdetails==dynamic}">
<ul data-sly-list.item="${model.items.listChildren}">
<li>${item.title}</li>
</ul>
</pre>
<pre data-sly-test="${properties.linkdetails==manual}">
<a href="${properties.pagelink @ extension='html'}">${properties.pagetitle}</a>
</pre>
Please help