Forum
Pagination previous link not working
Hey,
I'm using the standard snippet for pagination - for some reason the Previous link doesn't work - just wondering if anyone could help?
<perch:if exists="paging">
<div class="paging">
Page <perch:content id="current_page" type="hidden" /> of <perch:content id="number_of_pages" type="hidden" />
<perch:if exists="not_first_page">
<a href="<perch:content id="prev_url" type="hidden" encode="false" />">Previous</a>
</perch:if>
<perch:content id="page_links" encode="false" />
<perch:if exists="not_last_page">
<a href="<perch:content id="next_url" type="hidden" encode="false" />">Next</a>
</perch:if>
</div>
</perch:if>
In what way doesn't it work?
There's no url...
Are you using the standard
?page=2
format?Yep
Can you show me the debug from the page where it's not working?
This is from page 2
That's all of it? No routing information?
No, doesn't seem to be?
Are you using routing?
No, this is just a standard Perch site
Ah ok. Can you show me the options you're using?
You can't use
perch_collection()
on a standard Perch site.Sorry Drew, I'm getting my sites mixed up :-s
This is a Perch Runway site, upgraded from a basic Perch site. I can't actually remember if this ever used to work.
SO you can move forward through pages, but not back?
Yes, moving forward works ok - just can't go back using the prev link.
I'm having the same problem! I'm using the default pagination template, which looks like like Dan's above.
When I run
<perch:showall/>
, I see that theprev_url
variable is unset. I'm also using the standard ?page=1 format.By the way, I was able to find a workaround by using
prev_page_number
like this:That also worked for the blog pagination