Pagination - i'm doing something wrong

General ShopSite user discussion

Pagination - i'm doing something wrong

Postby shawn41 » Thu Nov 13, 2008 2:39 pm

I've researched the forum and have trialed-and-errored for an hour. I can't get this to work.

The pagination works, but for pages that do not have more than 10 products, the pagination text ("More Product Pages") is still showing up.

I've set up the pages' layout to show 10 products per page, and here's the code i'm using:

Code: Select all
[-- IF PAGE.ProductsPerPage 0 --]
# do nothing
[-- ELSE --]
<p><font face="Trebuchet MS" size="4">More Product Pages: [-- PrevNext NoCenter --]</p><br>
[-- END_IF --]
shawn41
 
Posts: 8
Joined: Thu Oct 16, 2008 11:50 am

Postby JeremeD » Thu Nov 13, 2008 6:29 pm

They way your code is set up, it's going to show the code you have in the ELSE part of your statement any time there are ANY products assigned to the page. Instead of adding the "More Product Pages:" text into the template you should add that into one of the store text fields so it will only show up when there is some pagination to generate.

Go under Preferences > Store Text, and you can edit the text for the Page, Prev, and Next fields.

Jereme
SD360.com
Certified ShopSite Designer
ShopSite Templates Available Now
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA

Postby shawn41 » Wed Nov 19, 2008 1:18 pm

Alright, this doesn't make any sense to me. I erased the information out of the code in the ELSE statement ""More Product Pages". I went to the store text page in the back office and I see options for: Prev, PrevSet, Next, NextSet, and that's about it for Paginaton. Now I'm getting page numbers. You can see here at the bottom. I just don't get it.

http://www.leatherandlacesite.com/store ... atches.htm
shawn41
 
Posts: 8
Joined: Thu Oct 16, 2008 11:50 am

Postby Jim » Wed Nov 19, 2008 1:40 pm

The Prev and Next text only are displayed if there are more than 2 pages of products. Since the page you reference only has 2 pages they are not displayed. Try setting the number of products per page to a lower number and you will see what I mean.

The Prev Set and Next Set will only appear if you have more pages than the number you set for the max links to display at a time.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby shawn41 » Wed Nov 19, 2008 2:48 pm

Okay, that makes sense. It just looks goofy down there with just a "1, 2" when there are only two pages of products.
shawn41
 
Posts: 8
Joined: Thu Oct 16, 2008 11:50 am

Postby loren_d_c » Thu Nov 20, 2008 11:36 am

As far as your original question goes, there is no tag specifically to determine if the [-- PrevNext --] tag will result in links.

However if all your pages have the same number in the Products Per Page
pagination settings, then you could put something like this in your
custom page template before your [-- PrevNext --] tag (this example
assumes your Products Per Page setting is 10, if yours is higher or lower
you would add or remove some ELSE_IFs, respectively):

Code: Select all
[-- IF PAGE.NumProducts 0 --]
[-- ELSE_IF PAGE.NumProducts 1 --]
[-- ELSE_IF PAGE.NumProducts 2 --]
[-- ELSE_IF PAGE.NumProducts 3 --]
[-- ELSE_IF PAGE.NumProducts 4 --]
[-- ELSE_IF PAGE.NumProducts 5 --]
[-- ELSE_IF PAGE.NumProducts 6 --]
[-- ELSE_IF PAGE.NumProducts 7 --]
[-- ELSE_IF PAGE.NumProducts 8 --]
[-- ELSE_IF PAGE.NumProducts 9 --]
[-- ELSE_IF PAGE.NumProducts 10 --]
[-- ELSE --]
    Go to page:
[-- END_IF --]


So basically this IF and ELSE_IFs will do nothing as long as the number
of items assigned to the page is 10 or less, but if it is over 10 then it
would fall into the final ELSE and print out the text that you want to
put prior to the PrevNext links.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere


Return to User Forum

Who is online

Users browsing this forum: No registered users and 115 guests