Created
June 5, 2018 07:11
-
-
Save StephanWeinhold/8c97efe6862abb7a246ad94dbf4a09fb to your computer and use it in GitHub Desktop.
Numbered pagination for Datenstrom's Yellow CMS. https://github.com/datenstrom/yellow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php list($name, $pages) = $yellow->getSnippetArgs() ?> | |
<?php if($pages->isPagination()): ?> | |
<div class="pagination"> | |
<?php if($pages->getPaginationPrevious()): ?> | |
<a class="previous" href="<?php echo $pages->getPaginationPrevious() ?>"><?php echo $yellow->text->getHtml("paginationPrevious") ?></a> | |
<?php endif ?> | |
<?php if($pages->getPaginationCount() > 1): ?> | |
<?php for($i = 1; $i <= $pages->getPaginationCount(); ++$i): ?> | |
<a class="pagination-number<?php if ($i == $pages->getPaginationNumber()) echo " active" ?>" href="<?php echo $pages->getPaginationLocation(true, $i) ?>"><?php echo $i ?></a> | |
<?php endfor ?> | |
<?php endif ?> | |
<?php if($pages->getPaginationNext()): ?> | |
<a class="next" href="<?php echo $pages->getPaginationNext() ?>"><?php echo $yellow->text->getHtml("paginationNext") ?></a> | |
<?php endif ?> | |
</div> | |
<?php endif ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just replace
/system/themes/snippets/pagination.php
with this file. I've tried to use the template coding style of the fine guys at Datenstrom - may the Clean Code-God have mercy with my soul :)