need help with custom product template

Questions and answers about ShopSite Custom Templates

need help with custom product template

Postby FredW » Thu Aug 15, 2013 12:59 pm

Hi,

I spend most of the afternoon trying to figure out how to make two custom changes to my product template.

I'm using the multi-use-product.sst (I'm actually using a modified version that I copied for other reasons ).

The changes I want to make I thought were simple, but I can't find where to make these specific changes. Any help would be appreciated.

The first change I want to make is to use the Product.Sku instead of the Product.RecordNumber to create the anchor name tag for each product entry in a page. That way I can create links to products within a page using the sku that won't change when the product's RecordNumber changes.

The second change is to allow the user to click on an resized small image we have for a product and have it open a new tab with a the larger (original size) image. I do not want to have to create a 'more-information' for these products, but do want to allow the user to see a larger view of the image. I'm not sure where this custom change would go.

Thanks in advance,
Fred W
FredW
 
Posts: 188
Joined: Mon Apr 02, 2012 2:07 pm

Re: need help with custom product template

Postby Jim » Thu Aug 15, 2013 3:06 pm

A general tip for trying to find out what file is being used to display content.
Go to Utilities > Publish > and check the box "Insert an html comment before each include file" and publish the store. Now open the page that has the problem in your browser and view the html source of the page. (in Firefox you right click and choose View Page Source I don't know how you do it in other browsers) In the html source you will see comments something like

Code: Select all
<!-- ***** Start of Include: [sc] Flex-Build-VARs.sst -->
some code possibly here.
<!-- ***** End of Include:  Flex-Build-VARs.sst -->
...
<!-- ***** Start of Include: [sc] Flex-Build-Head.sst -->
...

Then find the area you are wanting to modify and see which file is the last one mentioned in a Start of ... comment and that should be the file you need to look in.

I believe the <a name="##"></a> is part of the publish process and not part of any template. But it would be possible for you to do something similar by adding <a name="[-- product.sku--]></a> to the start of your product template.

For the popup image you would need to code some javascript to do the popup when clicking on the smaller image. There should be lots of examples of doing this if you do a websearch for "javascript popup image example". You may need to have the larger image name in one of the extra product fields since ShopSite template tags for images include the resized size image size in the url when you used one of the [-- product.graphic --] type tags. This may not get you the various sizes you need for the javascript. Another option is to force the image to be a smaller size in the product view and then display the image regular size when they click on it. This requires more bandwidth when loading the pages so that may be something you want to consider.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 10 guests

cron