Closed jamestagal closed 2 years ago
Hi @jamestagal,
By default pagers are set to null
instead of 1
now: https://github.com/plentico/plenti/issues/191#issuecomment-1186242647
So you need to change this line: https://github.com/jamestagal/plenti-educenter/blob/main/layouts/content/blog.svelte#L7
To something like:
$: currentPage = content.pager ? content.pager : 1;
Let me know if that works! Thanks!
Hi @jimafisk
Thanks for pointing that change out. However that causes it to append blog
to the end of the current blog
url when clicking page 2 or 1 buttons. see screenshot.
Also the other forward and back buttons are disabled.
Ben
Hi @jamestagal,
I just pushed a change that should fix this: https://github.com/jamestagal/plenti-educenter/commit/331f2dc459e778ee704ec8b537f2f50aca9ce7c2
The problem was the pagination links are all using relative links:
You could have changed all the relative links (e.g. blog/2
) to absolute links (e.g. /blog/2
) and that would have fixed it as well. However, adding a baseurl (like I did in my commit) allows you to serve your site off a subfolder (like https://mysite.com/mysite) if you'd like :).
Hi @jimafisk Thank you. Yes that fixed it! and having a baseurl is a nice to have feature. 😃
thanks again Jim. Ben
Hi @jimafisk I've just finished putting the pagination together for this theme and followed along with your tutorial but I am seeing a couple of problems. All the code seems to be fine and I am not getting any errors. However here are the issues:
blog
you can see the pagination ui appear quickly at the top of the page then it disappears. So it does not remain visible on the page.postsPerPage
to 4 but I still see 6 on the blog page.Could you please take a look for me when you can. 😄
Best regards, Ben