I'm working on a projects gallery which includes a number of drop down menus that filter the displayed projects. It works very well, displaying 12 projects per page.
However if I filter my projects by "State" under the "All Locations" drop down and select "VIC" it appends the URL with "?state=VIC". But if I try to click onto page 2 of the VIC displayed projects I return no results even though there is a page there. The code for the pagination is removing the "?state=VIC" from the URL.
So I've tried adding "?state=<xsl:value-of select="projectState" />" to my pagination code, but the selected states value is not being passed into it.
In your for.loop template, (which I'm presuming is where the page numbers are being generated?), you are using projectState but I can't see why the current node when you enter the for loop would be a project, unless I'm missing something?
Don't you want to grab the state out of the querystring if present for the pagination control?
The reason it is using currentPageUrl is to keep the URL the same but append the page number to the end of the URL. Without it the currentPageUrl code, the resulting URL becomes: http://isis.brandtoolbox.com.au/projects/state=&tid=4&page=4. Which isn't a page.
Can you suggest another alternative?
Yes I want to grab the state out of the querystring if it is present.
Pagination needs to include selected State
I'm working on a projects gallery which includes a number of drop down menus that filter the displayed projects.
It works very well, displaying 12 projects per page.
However if I filter my projects by "State" under the "All Locations" drop down and select "VIC" it appends the URL with "?state=VIC". But if I try to click onto page 2 of the VIC displayed projects I return no results even though there is a page there. The code for the pagination is removing the "?state=VIC" from the URL.
So I've tried adding "?state=<xsl:value-of select="projectState" />" to my pagination code, but the selected states value is not being passed into it.
Has anyone got any suggestions?
Cheers, JV
http://isis.brandtoolbox.com.au/projects/projects.aspx?state=VIC
ProjectsAlbum.xslt (code that displays the project gallery)
ProjectsFilter.xslt (code that filters the project gallery)
In your for.loop template, (which I'm presuming is where the page numbers are being generated?), you are using projectState but I can't see why the current node when you enter the for loop would be a project, unless I'm missing something?
Don't you want to grab the state out of the querystring if present for the pagination control?
Hi Rob,
The reason it is using currentPageUrl is to keep the URL the same but append the page number to the end of the URL. Without it the currentPageUrl code, the resulting URL becomes: http://isis.brandtoolbox.com.au/projects/state=&tid=4&page=4. Which isn't a page.
Can you suggest another alternative?
Yes I want to grab the state out of the querystring if it is present.
Solved it!
Thanks to Rob, I looked at my code again. Should have been using the following code:
Instead of the the code I was using:
Coolio, glad you solved it!
is working on a reply...