Understanding Product and Page Templates

General ShopSite user discussion

Understanding Product and Page Templates

Postby extragear » Wed Nov 05, 2008 11:49 am

Greetings:

Its been awhile since I worked on modifying our product and page templates. We use a custom set that we obtained from one of the Shopsite approved designers.

I'm alittle rusty at modifying the templates and have been struggling in getting the modified moreinformation template to be associated with the product.


Heres what I've done.


1. Created a new product layout (I simply copied another product layout and gave it a new name)

2. Created a new Include File to represent the more product information page. (Once again, I copied a preexisting more information page file.)

3. Made a few modifications to the new more product information page. (To start with I simply entered some text.)

4. I made sure that the new product layout references the new more product information page for the include.

5. Setup a new product and associated its product layout with the new product layout.

Regenerated the store. For some reason, the product isnt showing up with the text I inserted in the new more product information page.

What am I missing here? Its been awhile since I worked on this. Yes, I have reviewed the tutorial and help files provided.

Thanks

Tim
Cycleluggage.com
extragear
 
Posts: 169
Joined: Mon Apr 02, 2007 10:53 am
Location: Binghamton, NY

Postby loren_d_c » Wed Nov 05, 2008 1:12 pm

View the HTML source of the More Info Page in question and look for the Meta Generator tag right after the opening <head> tag. It should contain the name of the template that was used to generate the page. Does it reflect your new template name?

Note that some page templates can (through an optional extra parameter for the [-- PRODUCTS --] tag in the [-- LOOP PRODUCTS --] loop) override the template that is used for the product so that a specific product template is used instead of the one actually assigned to the product.

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

Postby extragear » Thu Nov 06, 2008 8:33 am

Loren

Thanks for the info. Your suggestions have clarified it for the most part.

Here is what I did:

1. I viewed the source code for the product in question and it was referencing the OLD product template

2. I checked the unmodified page template and it shows the following:



[-- END_IF --]
[-- LOOP PRODUCTS --]
<tr>
<td>[-- PRODUCT sd360_productFeatured_template.html --]</td>
</tr>
[-- END_LOOP PRODUCTS --]
<tr>
<td><hr noshade></td>
</tr>
[-- IF Page.Text2 --]
<tr>
<td style="padding: 10px">[-- Page.Text2 --]</td>
</tr>
[-- END_IF --]
[-- IF Page.NumProducts 0 --]
[-- ELSE --]
<tr>
<td style="padding: 10px"><table width="100%" border="0" cellspacing="0"

cellpadding="5">
[-- LOOP PRODUCTS 3 --]
<td width="33%" valign="top" align="center">
[-- PRODUCT --]
</td>
[-- END_LOOP PRODUCTS --]
</table>


3. PRODUCT sd360_productFeatured_template.html is the OLD product template.

So I as you mentioned, the product template is hard coded into the page template.

Ok, this clarifies it for the most part.

4. I made a NEW page template that references the NEW product template.


I called the new product template sd360_productFeatured_templatemod.html

Ok, great. I regenerated and the product in question is now using the new product template along with its associated new product more information include. Great.

5. But then I began to think about the following situations:

A. If you have a product and its not assigned to any page, would the product then use whatever layout that it was assigned?

From the very limited experiments I did I would say yes.

B. What if a product is assigned to three different pages. Each page is assigned to a different page layout. And each page layout references a different product layout.

Is there a pecking order as to which page layout which predominate?

Once again, I did some experiments and but couldnt find an answer.

6. I then reconsidered what you stated about the page template. Specifically about how,

"Note that some page templates can (through an optional extra parameter for the [-- PRODUCTS --] tag in the [-- LOOP PRODUCTS --] loop) override the template that is used for the product so that a specific product template is used instead of the one actually assigned to the product."


With this in mind I created a new page template. I simply copied our original template. Then I removed the following:


[-- END_IF --]
[-- LOOP PRODUCTS --]
<tr>
<td>[-- PRODUCT sd360_productFeatured_template2.html --]</td>
</tr>
[-- END_LOOP PRODUCTS --]

7. At this point I went and assigned this new page template to a page. Then I assigned some products to this page. Some products used the new product template and some used the old product template. Regenerate.

And presto it appears now that whatever layout is assigned at the product level will not be overridden when its assigned to a page that features this new page layout.


So my questions concerning this are:

A. Is this analysis correct?
B. Is there a reason for hard coding the product layout in the page layout?


Thanks

Tim
extragear
 
Posts: 169
Joined: Mon Apr 02, 2007 10:53 am
Location: Binghamton, NY


Return to User Forum

Who is online

Users browsing this forum: No registered users and 91 guests