Product Links in Custom Templates

General ShopSite user discussion

Product Links in Custom Templates

Postby GiftSpecialists » Thu Sep 13, 2007 5:58 am

Does anyone out there know a way to get the same product to show up in a different format depending on the page that links to it?

Example: I want a link to the product more-info page to be displayed with its graphic above the name on Page-A, but I don't want the graphic to be displayed if the link to the product more-info page is displayed on Page-B.

Can I use 2 different templates for the same product?

Thanks for any help.
Rick,

www.GiftSpecialistsInc.com
www.WineGiftClub.com - Gifts for wine lovers
www.BeerOnTheWall.com - Gifts for beer lovers
GiftSpecialists
 
Posts: 130
Joined: Thu Aug 17, 2006 7:20 am
Location: Modesto, California

Postby Jim » Thu Sep 13, 2007 6:29 am

In the page template you can specify the template that a product uses on that page by adding the template name to the [-- Product --] tag like this

Code: Select all
[-- LOOP PRODUCTS --]
[-- PRODUCT template --]
[-- END_LOOP PRODUCTS --]


Note that the Moreinfo page for the product will only be generated once for each publish and it will use the definition in the first product template that is encountered so if you want the moreinfo pages to be consistant make sure that you use the same definition in all product templates.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby GiftSpecialists » Thu Sep 13, 2007 9:35 am

Thanks Jim, that is exactly what I was looking for. I figured it had to be possible.

[ quote]Note that the Moreinfo page for the product will only be generated once for each publish and it will use the definition in the first product template that is encountered so if you want the moreinfo pages to be consistant make sure that you use the same definition in all product templates.[/quote]

In what order does SS encounter the templates? By Name?
Rick,

www.GiftSpecialistsInc.com
www.WineGiftClub.com - Gifts for wine lovers
www.BeerOnTheWall.com - Gifts for beer lovers
GiftSpecialists
 
Posts: 130
Joined: Thu Aug 17, 2006 7:20 am
Location: Modesto, California

Postby Jim » Thu Sep 13, 2007 10:57 am

The first time the product is encountered is when the moreinfo page is generated. This may occur on a page that was change since the product may be assigned to multiple pages or when it is found as a subproduct to another product, or by the page record number if a full regen is done. So there is really no way to predict which will happen first.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby GiftSpecialists » Thu Sep 13, 2007 1:15 pm

Understood - so basically, I should just be sure that the remainder of the templates are identical, and if i make changes to one, be sure and transfer them to the other as well.

Thank for all you insight Jim - I do appreciate it.
Rick,

www.GiftSpecialistsInc.com
www.WineGiftClub.com - Gifts for wine lovers
www.BeerOnTheWall.com - Gifts for beer lovers
GiftSpecialists
 
Posts: 130
Joined: Thu Aug 17, 2006 7:20 am
Location: Modesto, California

Postby JeremeD » Sat Sep 15, 2007 7:26 pm

Rick,

One really simple way to make sure your more info page templates remain the same is to use just one that is defined as an include in your product templates. Like this:

Code: Select all
[-- DEFINE MORE_INFO_PAGE --]
[-- INCLUDE moreInfo.html PROCESS --]
[-- END_DEFINE MORE_INFO_PAGE --]


This way you only have to update one page instead of trying to match changes across several. You can use this same method to include product and subproduct templates as well.
SD360.com
Certified ShopSite Designer
ShopSite Templates Available Now
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA

Postby GiftSpecialists » Mon Sep 17, 2007 9:01 am

Yeah! I like it. I never thought of that.

Thnaks for the tip Jereme.
Rick,

www.GiftSpecialistsInc.com
www.WineGiftClub.com - Gifts for wine lovers
www.BeerOnTheWall.com - Gifts for beer lovers
GiftSpecialists
 
Posts: 130
Joined: Thu Aug 17, 2006 7:20 am
Location: Modesto, California


Return to User Forum

Who is online

Users browsing this forum: No registered users and 106 guests