Can't get pagination to work
Hi,
How do I set which page to show results for? I only get results for the first page, no matter which page I click on.
Hi,
How do I set which page to show results for? I only get results for the first page, no matter which page I click on.
Replies
Low 10 Jan 2012 15:13
Which add-on are we talking about, here? EE, PHP and add-on versions? Got a code example?
owe 10 Jan 2012 15:17
Oh. Sorry. Low GoogleSearch.
I suspect it may have something to do with freebie? Low GoogleSearch doesn't find the pagination segment because freebie has removed it?
Low 10 Jan 2012 15:36
It might well be a Freebie thing. Low GoogleSearch looks at the current URI for a Pn segment (where n is a number). I'm not familiar with Freebie, but if it changes the URI internally, then that could cause trouble, yes.
owe 10 Jan 2012 15:47
It does change the URI internally, so what I was hoping for was a secret parameter to pass in the segment manually. Something like pagination="{freebie_3}", where {freebie_3} is the segment that was removed internally. There is no such thing i guess?
Low 10 Jan 2012 15:51
There's the start="" parameter, but you'd need to filter out the P, which you could probably do with PHP in your template.
owe 10 Jan 2012 15:54
Ah, okey. Excellent! Thanks a lot!
owe 10 Jan 2012 16:01
That doesn't seem to work though? start="10" still shows me page 1.
Low 10 Jan 2012 16:19
Does it work if you hardcode the start="" param? Also, try a different number, like 2 or 3.
owe 10 Jan 2012 23:21
Of course it does. Stupid me :-) I parsed the PHP on the output. I'll figure this out somehow, but the most elegant solution would be to pass in the segment using freebie. Would you consider adding such a parameter in the future? Then I could do something like pagination_seg="{freebie_3}"
Low 11 Jan 2012 09:48
I'll look into just stripping the P from the start="" parameter automatically. That would have the same effect.
For now, you could also use Low Replace to strip out the P from the pagination links, so you end up with just a number in the url, which you can feed to the start="" param. Something like this: