Jump to content

paginating results generated from values in GET


purwa
 Share

Recommended Posts

Hi Everyone.

I need help to paginate search results generated from a search form.

my search result url:

http://mysite.com/search/?products=tshirt&size=xl

how do I keep the value when generating pagination using MarkupPagerNav?

like on SKyscrapers example: 

http://processwire.com/skyscrapers/search/page2?city=albuquerque
 

(tried to look at the source code but can't find where Ryan set the pagination options, maybe I missed it? can someone point it out to me :D )

at the moment  my pagination link only showing the page number without the get value i.e:

http://mysite.com/search/page2
 

however, it showing correct results if I type the url manually  like: 

http://mysite.com/search/page2?products=tshirt&size=xl
 

I'm assuming I need to set the getVars in the pagination options

can you give me example how to use the "getVars"? I've set the cache to 0 in the template setting.

my code:

$pagination = $matches->renderPager(array(
				'nextItemLabel' => "»",
				'previousItemLabel' => "«",
				'listMarkup' => "<ul class='MarkupPagerNav pagination'>{out}</ul>",
			));

thank you!

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...