![]() |
page navigation |
Post Reply ![]() |
Author | |
ptucker ![]() Newbie ![]() Joined: 09-October-2008 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() Posted: 16-October-2008 at 10:16am |
When browsing products the navigation is: Page 3 of 41 - 1 2 3 4 5 6 7 8 9 10 11 Next 10 Pages Last
I want to add a "previous page" and "next page" to make it easier for the customers. Having to click the page number to move to the next page is a pain and not user friendly. How can I accomplish this so it looks something like this:
Page 3 of 41 - Previous Page 1 2 3 4 5 6 7 8 9 10 11 Next Page Next 10 Pages Last
viewcategories.asp is the page this appears on. |
|
![]() |
|
BrianRoden ![]() Groupie ![]() Joined: 07-September-2007 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
I'm still testing, but here's what I came up with this afternoon trying to do the same thing.
There are two sections to insert around the for...next loop that writes the page number links. I've included the whole block from the beginning of my code, through ProductCart's for...next loop, to the end of my second insertion. All this is around line 990.
<!-- Previous Page inserted by Brian Roden 05/13/09 --> if iPageCurrent > 1 then%> <a rel="nofollow" href="viewCategories.asp?pageStyle=<%=pcPageStyle%>&ProdSort=<%=ProdSort%>&page=<%=iPageCurrent-1%>&idCategory=<%=mIdCategory%><%=pcv_strCSFieldQuery%>">Previous page</a><%end if<!-- end Previous Page insertion --> For pageNumber=intPageNumber To (cint(iPageCurrent) + (iPageNext)) If Cint(pageNumber)=Cint(iPageCurrent) Then %> <strong><%=pageNumber%></strong><% Else %> <a rel="nofollow" href="viewCategories.asp?pageStyle=<%=pcPageStyle%>&ProdSort=<%=ProdSort%>&page=<%=pageNumber%>&idCategory=<%=mIdCategory%><%=pcv_strCSFieldQuery%>"><%=pageNumber%></a><% End If Next <!-- Next Page inserted by Brian Roden 05/13/09 --> if iPageCurrent < cint(thepagecount) then%> <a rel="nofollow" href="viewCategories.asp?pageStyle=<%=pcPageStyle%>&ProdSort=<%=ProdSort%>&page=<%=iPageCurrent+1%>&idCategory=<%=mIdCategory%><%=pcv_strCSFieldQuery%>">Next page</a><%end if<!-- end Next Page insertion --> |
|
![]() |
|
worldofrugs ![]() Senior Member ![]() ![]() Joined: 24-April-2008 Location: United States Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Hey Brian,
Super you are doing this, as it is exactly what I'm trying to implement now in V 3.12 (yeah I need to update once I get a chance haha!)... You stated in your post, that you're still testing it.. As the post was of May-13... Have you finished / implemented it? If so, do you mind sharing it with me / us ? I would be SOOOOOO greatfull!! ![]() Also what version are you using, as it might be slightly different? Please let me know when you have a chance... Thanks ![]() Edited by worldofrugs - 05-June-2009 at 4:16pm |
|
![]() |
|
BrianRoden ![]() Groupie ![]() Joined: 07-September-2007 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
I posted the code before completely testing it, but it worked A-OK as posted. Use it! |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |