Detect 1st page of multipage product line during generation

General ShopSite user discussion

Detect 1st page of multipage product line during generation

Postby redskys » Wed Dec 10, 2008 3:39 pm

I have several product lines that require multiple pages to show all the products.

I want to include the javascript snippet that Google requires for the Google Analyzer, but I want to put it only on the first page of each product line.

If I could test for page one of each product line during page generation, I could put in a conditional include, but I have no idea of how to flag or detect page one during page generation.

Any ideas would be appreciated.

D McLaughlin
redskys
 
Posts: 10
Joined: Fri Oct 05, 2007 8:53 am

Postby redskys » Mon Dec 15, 2008 2:10 pm

Seems no one likes the question
redskys
 
Posts: 10
Joined: Fri Oct 05, 2007 8:53 am

Postby loren_d_c » Mon Dec 15, 2008 4:24 pm

I can't think of any way to do that, sorry.

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

Postby JeremeD » Wed Dec 17, 2008 11:32 am

You can use php to do this.

When shopsite generates pagination it adds "-ssx" to the end of each paginated page. Use code like this:

Code: Select all
[-- IF Page.NumProducts 0 --]
[-- ELSE --]
 <?PHP

  if ( !eregi('-ss\d+\.html',$_SERVER['SCRIPT_FILENAME']) ) {
   echo "Your code here.";
  }

 ?>
[-- END_IF --]


All this does is check to see if the page has products and also doesn't have the -ssx part in the url. So this should add your code, but only to the first page of products.

Don't forget to escape the analytics code.
SD360.com
Certified ShopSite Designer
ShopSite Templates Available Now
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA

Thank you to JeremeD

Postby redskys » Mon Dec 22, 2008 2:07 pm

Thank you. Exactly the sort of thing I was looking for.

redskys

D McLaughlin
redskys
 
Posts: 10
Joined: Fri Oct 05, 2007 8:53 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 104 guests