Pagination code help.

General ShopSite user discussion

Pagination code help.

Postby lordofdirt » Wed Jun 04, 2008 8:53 am

I've been working with the pagination feature and was wondering how I can modify the code I used to not display "Pages" unless there are other pages?


Heres a link, with an example of my problem... Below is the code I'm using for pagination in our custom product page template.
http://www.americannutrition.com/store/ ... hione.html

Code: Select all
[-- IF PAGE.ProductsPerPage 0 --]
# do nothing
[-- ELSE --]
     [-- IF PAGE.NumProducts 0 --]
#do not output the Page Name
     [-- ELSE --]
#there are products, so output the page name
     <h2 style="text-align:center">Pages:</h2>
     [-- END_IF --]
<p style="text-align:center">[-- PrevNext --]</p>
[-- END_IF --]
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby lordofdirt » Thu Jun 05, 2008 12:12 pm

No one can help me?
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby lordofdirt » Thu Jun 05, 2008 12:14 pm

can I use inequalities in the code?

like...

Code: Select all
[-- IF PAGE.NumProducts < 21 --]
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby loren_d_c » Thu Jun 05, 2008 3:33 pm

No, you can't use greater-than or less-than comparisons in a custom template IF tag. Why not just use PAGE.NumProducts again?

[-- IF PAGE.NumProducts 0 --]
#no pages
[-- ELSE --]
#there are pages, so...
<h2 style="text-align:center">Pages:</h2>
[-- END_IF --]

Or just move your initial [-- IF PAGE.NumProducts 0 --] out around this whole thing, maybe that would be easier. Like I said before, there is more than one way to skin a cat.

-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 97 guests

cron