pagination

arfa
Master Bludit
Posts: 164
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

I am just getting started. Bludit has been on my list for a long time +++

I have moderate php/code experience. Starting with blogx theme.
I see in the blogx/php/home.php there is a code block comd: Pagination
This offers a 'home' > 'next' option. Great. But I wonder if there is a numbered pagination method: something like...
first 1 2 3 ... next last - this is pretty standard.

I see in the plugins list [about 3/4 down] there is
PAGINATION
Made by SamBrishes, pytesNET
the link...
https://plugins.bludit.com/plugin/pagination#download
shows 'not found'

1 - does anyone have a copy of this plugin (assuming it still works :)
2 - is there an alternative?

thx - Kusalo
arfa
Master Bludit
Posts: 164
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

I found this when searching 'plugins'
viewtopic.php?p=13256#p13256
but the offered links are not working.
- ak
User avatar
SpegalDev
Sr. Bludit
Posts: 38
Joined: Tue Jun 13, 2023 11:27 pm
Location: Michigan, USA
Has thanked: 6 times
Been thanked: 34 times
Contact:

I've manually coded pagination into a few of my Bludit sites. I'll see if I can convert it into a plugin in the next day or two.
Image BluditLab — Explore a comprehensive collection of Bludit themes and plugins, offering both free and premium options to elevate your Bludit site. Find the perfect tools for customization, SEO, and more.
User avatar
SpegalDev
Sr. Bludit
Posts: 38
Joined: Tue Jun 13, 2023 11:27 pm
Location: Michigan, USA
Has thanked: 6 times
Been thanked: 34 times
Contact:

https://bluditlab.com/plugins/content/simple-pagination

Just released our Simple Pagination plugin here if you're interested. :D
Image BluditLab — Explore a comprehensive collection of Bludit themes and plugins, offering both free and premium options to elevate your Bludit site. Find the perfect tools for customization, SEO, and more.
arfa
Master Bludit
Posts: 164
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

That looks fine. Just a note: the landing page does not show any pagination. I had to click around to find a 1 2 3 example. No big deal. It is very early morning here in New Zealand so I will get back to this.
Thank you.
User avatar
Jay
Master Bludit
Posts: 144
Joined: Mon Feb 11, 2019 8:41 pm
Has thanked: 6 times
Been thanked: 4 times

arfa wrote: Wed Jul 17, 2024 11:15 pm 2 - is there an alternative?
have a look at paginator.class in /kernel/helpers
there's already an inbuilt, and ready to use bootstrap_html() function

---
https:/nietak.de
Last edited by Jay on Wed Feb 26, 2025 12:59 am, edited 1 time in total.
arfa
Master Bludit
Posts: 164
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

home page pagination is not site-build critical so I have not given much time to your suggestion Jay regarding the bootstrap_html() function

There is also my coding limitations - generally and bludit specific - so it currently feels that this would require a bit of more direct guidance. ie. how to activate that function into home.php?

a kick starter plz.?

thx - Kusalo
User avatar
Jay
Master Bludit
Posts: 144
Joined: Mon Feb 11, 2019 8:41 pm
Has thanked: 6 times
Been thanked: 4 times

Check available bludit's themes. I remember some of them had numbered pagination instead of basing only on default prev/next, thus you could check their sourcecode.
arfa
Master Bludit
Posts: 164
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

Yes, a good suggestion. I was just about to say but... bludit.com is down - but it is back up. YAY! Well done to all those who were working on that.

I will trawl a few themes and see what comes up and report back.
thx - Kusalo
arfa
Master Bludit
Posts: 164
Joined: Tue Jul 04, 2017 4:31 am
Location: New Zealand
Has thanked: 13 times
Been thanked: 27 times

I have spent far too long trawling themes but found a jewel - blekathon. All it required was replacing the existing code in blogx/php/home.php - at the bottom. I imagine it can be used for other themes. The theme has an MIT license so I figure it is OK to post the code here...
Thanks to the good people @ blthemes.pp.ua

Code: Select all

<!-- Pagination -->
<?php if (Paginator::numberOfPages() > 1) : ?>
<!-- START this pagination taken from Blekathlon theme -->
<nav class="navigation pagination" role="navigation" aria-label="Page navigation">
			<h3 class="screen-reader-text">Posts navigation</h3>
			<div class="nav-links">

				<?php if (Paginator::showPrev()):?>
				<a class="prev page-numbers" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">
					<?php echo $L->get('Previous'); ?>
				</a>
				<?php endif ?>

				<?php
                  //max 9 pages with move
                  $pmax = max(Paginator::currentPage() + 4, 9);
                  $pmin = min(Paginator::currentPage() - 4, Paginator::numberOfPages()-8);
                ?>
				<?php for ($i = max(1, $pmin); $i <= min($pmax,Paginator::numberOfPages()); $i++): ?>
				<?php if(Paginator::currentPage() == $i): ?>
				<span class="page-numbers current">
					<?php echo $i ?>
				</span>
				<?php else: ?>
				<a class="page-numbers" href="<?php echo Paginator::numberUrl($i) ?>">
					<?php echo $i ?>
				</a>
				<?php endif; ?>
				<?php endfor; ?>

				<?php if (Paginator::showNext()):?>
				<a class="next page-numbers" href="<?php echo Paginator::nextPageUrl() ?>">
					<?php echo $L->get('Next'); ?>
				</a>
				<?php endif ?>

			</div>
		</nav>
<!-- END blekathlon pagination -->
  
<?php endif ?>
Another happy ending :)

thx - Kusalo
Post Reply