Pagination if i have many pages

Post Reply
GEORGE
Jr. Bludit
Posts: 5
Joined: Thu Nov 24, 2022 7:59 pm
Has thanked: 1 time

Is there an easy way/example of a code snippet that adds an ellipsis if, for example, there are too many pages:
321.png
321.png (2.71 KiB) Viewed 398 times
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Which theme do you use?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
GEORGE
Jr. Bludit
Posts: 5
Joined: Thu Nov 24, 2022 7:59 pm
Has thanked: 1 time

Edi wrote: Mon Apr 24, 2023 12:16 am Which theme do you use?
I created my own theme. It is based on the theme of the Mars :D
Pagintaion code:

Code: Select all

<?php if (Paginator::numberOfPages()>1): ?>
<div class="pagi-nav">
	<nav class="pgn">
		<?php if (Paginator::showPrev()): ?>
		<span class="pprev"><a  href="<?php echo Paginator::previousPageUrl() ?>">Назад</a></span>
		<?php endif ?>
		<ul class="navigation">
			<?php for ($i=1; $i<=Paginator::numberOfPages(); $i++): ?>
			<li><a <?php if (Paginator::currentPage() == $i): ?> class="current" <?php endif ?>href="<?php echo Paginator::numberUrl($i) ?>"><?php echo $i ?></a></li>
			<?php endfor ?>
		</ul>
		<?php if (Paginator::showNext()): ?>
		<span class="pnext"><a href="<?php echo Paginator::nextPageUrl() ?>">Вперед</a></span>
		<?php endif ?>
	</nav>
</div>
<?php endif ?>
Post Reply