Having issues with VAR tags

General ShopSite user discussion

Having issues with VAR tags

Postby elsparkodiablo » Sat May 05, 2007 9:33 pm

I'm redesigning my store and one of the issues I seem to be having is having VAR tags carry over from within [--DEFINE PRODUCT--] to the More Info templates themselves.

Then I realized that I'm just working way too hard for something that should be simple.

The premise is that I'm using one More-Info template. For the purpose of this discussion, we'll call it 1sks-8.3-more-info

Within the more info template there's all the usual stuff, but with 8.3's new database fields being available, I've created a variety of HTML tables set to accept data from PRODUCT.Field1 through PRODUCT.Field10 - each of those tables is in it's own include file called specs-table-folder, or specs-table-fixed, or specs-table-flashlight, etc.

The idea is that I wanted to create a variable, called VAR.specs-table

Based on the product template selected, VAR.specs-table would be set to "Folder" or "Fixed" or "Flashlight" or whatever. Unfortunately, VAR.specs-table doesn't seem to be populating across to the more info page templates. Specifically, it doesn't seem to be travelling across all the varied includes being used to make the More Info template.

I know the VAR.specs-table is being set, because as a test I had it display on the page where the product is found. It just doesn't seem to be getting transferred to the more info page.

Should I just post the code I'm using or should I email this?

EDIT: Actually, here's another idea. Is there a tag for the product template (that the user selects in the back end, something like [-- PRODUCT.template --]? I don't see that anywhere in the tag specifications, despite the availbility of tags for alignments, images, etc.
elsparkodiablo
 
Posts: 32
Joined: Sat May 05, 2007 9:17 pm

Postby Jim » Tue May 08, 2007 9:16 am

I thought I had already responded to this but I don't see my message so I'll send another.

You specify the template for a product on the Edit Product Layout screen. You can't change that template within a product template (because by the time you are in the product template the the code is processing the one assigned) but you can specify a different product template when you are on a Page template in the loop product section by specifying the name of the product template as a parameter to the PRODUCT tag.

[-- Loop Products --]
[-- PRODUCT mytemplate --]
[-- End_loop Products --]

Note that the more info page for a product is only generated once during a publish and it will use the [-- DEFINE MORE_INFO_PAGE --] section of the product template in affect at the time. This means that you need to make sure that the moreinfo section of all product templates are the same if you want to make sure that all moreinfo pages need to look the same and you are switching the product template in the Loop Product section.

VARs remain active throughout the publish so if you want them to be inactivated you should initialize the var before you process a section of code and then reset it to another value when you are finished with that secton.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby elsparkodiablo » Tue May 08, 2007 12:17 pm

Apparrently I didn't make my exact problem clear enough. It's ok though, I cheated and used the Google Product Category field to specify what include to be called when generating the more information page. Instead of using a VAR.specs-table routine to call the correct specifications table, I just am using a series of IF / ELSE queries now and it's working 100%

This is great for me, because it requires me to remember to set the google category for the product when creating the more information page, and I'm being uniform in the product category, and that category is used to include the correct product specifications table. Win-win-win.

Thanks for the assistance though.
elsparkodiablo
 
Posts: 32
Joined: Sat May 05, 2007 9:17 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 60 guests