Skip to content

Instantly share code, notes, and snippets.

Created June 20, 2012 15:36
Show Gist options
  • Select an option

  • Save anonymous/2960534 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/2960534 to your computer and use it in GitHub Desktop.
Kirby Search
<?php if($pagination->countItems() > 10): ?>
<!-- site/snippets/pagination.php -->
<nav role="pagination">
<div class="count">
<?php if($pagination->countItems() < 10): ?>
<strong><?php echo $pagination->countItems() ?></strong> Results / showing <strong><?php echo $pagination->numStart() ?></strong> - <strong><?php echo $pagination->countItems() ?></strong>
<?php else: ?>
<strong><?php echo $pagination->countItems() ?></strong> Results / showing <strong><?php echo $pagination->numStart() ?></strong> - <strong><?php echo $pagination->numEnd()) ?></strong>
<?php endif ?>
</div>
<div class="buttons">
<?php if($pagination->hasPrevPage()): ?>
<a class="prev" href="<?php echo $pagination->prevPageURL() ?>">&lsaquo; previous</a>
<?php else: ?>
<span class="prev">&lsaquo; previous</span>
<?php endif ?>
<?php if($pagination->hasNextPage()): ?>
<a class="next" href="<?php echo $pagination->nextPageURL() ?>">next &rsaquo;</a>
<?php else: ?>
<span class="next">next &rsaquo;</span>
<?php endif ?>
</div>
</nav>
<?php elseif($pagination->countItems() < 10): ?>
<nav role="pagination">
<div class="count">
<strong><?php echo $pagination->countItems() ?></strong> Results
</div>
</nav>
<?php endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment