Screen: ShopSite > Merchandising > Custom Templates
Most global tags can be used in any type of custom template.
With the optional PROCESS parameter, any custom template tags in contents of filename are replaced with their database values before the contents are placed into the output file.
[-- VAR.t2 PAGE.Text2 --]
You could later retrieve that value with this command:
[-- VAR.t2 --]
You can store almost any value in a VAR variable. These two commands store a numeric value and a string value, respectively:
[-- VAR.numcolumns 2 --]
[-- VAR.bargain "Bargain of the day!" --]
If the value stored is numeric, you can increment or decrement the value by 1 with the INC and DEC parameters, like this:
[-- VAR.t2 INC --]
Once a VAR is defined, it's value is available during the rest of the store generation process and can be called from both page and product templates. It can also be used in LOOP and CALL statements, like this:
[-- LOOP PRODUCTS VAR.numcolumns --]
[-- CALL program.cgi VAR.xxxx --]
You can nest [-- IF --] tags, and you can use multiple
Any custom template tags within the conditional content are replaced with information from the pages and products databases before the content is added to the current page.
The following example tests whether the merchant has checked the box to display the page name, and inserts the contents of the PAGE.Name field if it checked:
[-- IF PAGE.DisplayName --]
<H1>[-- PAGE.Name --]</H1>
[-- END_IF --]
This example tests whether the page name matches a string, and inserts the contents of the PAGE.Field1 field if it matches:
[-- IF PAGE.Name "About Us" --]
<H1>[-- PAGE.Field1 --]</H1>
[-- END_IF --]
The CALL tag can only be used in a page or product template, and the user-supplied program must be in the ShopSite CGI directory.
You can use constants (digits and strings) as parameters, and any of the following custom template tags, which will be substituted before the program is called:
Example:
The above example would call a program called createthumbnail.pl in the ShopSite CGI directory, and pass in the values 20, 20, and a full <img> tag for the graphic of the current product. This program might return an <img> tag to a newly-created 20x20 thumbnail of the product graphic.
Most store tags can be in all templates, and can be used with the REMOVE_HTML parameter.
With the optional BASE parameter, this tag returns the URL to the shopping cart CGI directory (as set in
Note that if you use this tag in a custom page template (not a product template), you cannot use the
<a href="[--SHOPPING_CART_URL--]"><img src="media/view_cart1.gif"></a>
The default values for these fields are shown here, but the merchant can change the text.
1 The custom templates feature cannot be used to create all of the features that are present in the built-in ShopSite templates.
2 Several fields have default values and will never return null, and thus cannot be used in an IF statement. See the page tags and product tags to find the possible values for each field.
|
ShopSite Help and Resource Center February 13, 2004 Give Feedback |
![]() © 2005, ShopSite, Inc. ShopSite Shopping Cart Software |