/macros/PageList
Type: /type/macro
macro: value: $def with (path="", limit=50, use_repr=False)

$ path = query_param("path", path)
$ page = safeint(query_param("page", "0"))
$ pages = list_pages(path, limit=limit, offset=page * limit)

<!--islist-->

<div class="contenttext">
<ul>
$for p in pages:
    $if p.type.key != '/type/delete':
        $if use_repr:
            <li>$:thingrepr(p)</li>
        $else:
            <li><a href="$homepath()$p.key">$p.key</a></li>
</ul>
</div>

<div class="copyright-footer">
$if page != 0:
    &larr; <a href="$:changequery(page=page - 1)" rel="nofollow">$_.prev</a>

$if len(pages) == limit:
    ... <a href="$:changequery(page=page + 1)" rel="nofollow">$_.next</a> &rarr;
<div>