silverstripe-blog/templates/Includes/Pagination.ss
2015-11-13 15:06:29 +13:00

26 lines
564 B
Scheme

<%-- NOTE: Before including this, you will need to wrap the include in a with block --%>
<% if $MoreThanOnePage %>
<p class="pagination">
<% if $NotFirstPage %>
<a class="prev" href="{$PrevLink}">&larr;</a>
<% end_if %>
<% loop $Pages %>
<% if $CurrentBool %>
<span>$PageNum</span>
<% else %>
<% if $Link %>
<a href="$Link">$PageNum</a>
<% else %>
<span>...</span>
<% end_if %>
<% end_if %>
<% end_loop %>
<% if $NotLastPage %>
<a class="next" href="{$NextLink}">&rarr;</a>
<% end_if %>
</p>
<% end_if %>