Forum
Identifying the first page of pagination
Hi Drew,
Is there a way of identifying which is the first page when using pagination, I would like to have an intro para above the paginated content but only want it visible on the first page. If I could identify the first page I could hide it on the subsequent ones.
I've achieved the effect using a combination of perch before and if/else however it results in unnecessary entry fields in the admin.
Any thoughts?
All the templates variables are listed here: https://docs.grabaperch.com/docs/templates/pagination/
You could do something like
That's kinda what I arrived at using not_first_page but more streamlined without the need for an else statement - however in the admin, because its a region that allows multiple items it means that for each item I get an "Intro" entry field, which only needs to be filled on the first instance to add the intro para but not on all the subsequent ones. No worries its not a biggie.
Put the intro in another region and pass it into the template.
Hi Drew, I'm back on to this in an attempt to tidy up a few loose ends, not entirely sure how to do this could you elaborate.
Sure, which part are you having problems with?
how to pass a stand-a-lone intro region into the template of the content paginated (desired end result is an intro para which only appears at the top of the first page of paginated content.)
Ah ok, try here: https://docs.grabaperch.com/docs/templates/passing-variables-into-templates/