ListChildren looks recursively

There is one page interface method that can be used to monitor children.

I want to repeat all the following lines.

there is an overloaded method listChildren (Filter, Boolean) that can do this ... how to call this method from visible? I mean, how should the Onemodify tag mentioned above do it recursively.

+3


source to share


1 answer


You can define data-sly-template

which is a kind of macro and then call it recursively with data-sly-call

:



<template data-sly-template.descendants="${@ page}">
    ${page.title}
    <ul data-sly-list.child="${page.listChildren}">
      <li data-sly-call="${descendants @ page=child}"></li>
    </ul>
</template>

<div data-sly-call="${descendants @ page=currentPage}" data-sly-unwrap></div>

      

+14


source







All Articles