Funkce paging nad výsledky fulltextu
Pracuje se s hodnotou result.count
, do které pagelet zveřejňuje počet nalezených výsledků.
Fragmenty kódu
Defaultní režim šablony pageletu
{while result}
{whilefirst}
{let p := paging(result.count, "startPos", asMap(
"pageSize", 15,
"pageSizeParam", "perPage"
))}
{with p _template mode="paging" p=_ /with}
{/whilefirst}
... výpis položky ...
{whilelast}
{with p _template mode="paging" p=_ /with}
{/whilelast}
{/while}
Režim "paging" šablony pageletu
{with p.prev}
<a href="{p.first.addr}">první</a> |
<a href="{_.addr}">předchozí</a> |
{/with}
{while p.console}
{if _.shown}
<strong>{_.number}</strong>
{else}
<a href="{_.addr}">{_.number}</a>
{/if}
{if not _last}<span class="sep"> | </span>{/if}
{/while}
{with p.next}
| <a href="{_.addr}">následující</a>
| <a href="{p.last.addr}">poslední</a>
{/with}