Category Display with Templates

If you want more control over how your categories are displayed, it is possible to replace the default formatting of categories with your own unique HTML using templates. A template can be created using your favorite editor and is simply plain HTML with the addition of some special syntax that tells VPCART where it needs to fill in information from the database.

 

To use templates, you need to change the first Software Configuration value.

Xcategoryusetemplate

Settingthis to Yes switches to template mode

xcategorydisplaytemplate

This is the folder and name of the template to use. The default is tmp_categorytemplate.htm

 

Any field in the categories table can be placed into your template. The field must be surrounded by square brackets, as shown in the following example.

 

<table border="0" cellpadding="2" width="100%">

<tr>

<TD valign=top align=center>

<a href="shopdisplayproducts.asp?id=[categoryid]&cat=[urlencode catdescription]">

<img border="0" src="[catimage]">

</a>

</td>

</tr>

<tr>

<td align=center valign=top>

<a href="shopdisplayproducts.asp?id=[categoryid]&cat=[urlencode catdescription]">

    [catdescription]

</a>

</td>

</tr>

<tr>

<td valign=top align=center>

$  [catmemo]

</td>

</tr>

</table>

 

Note: Adding a $ symbol at the very start of the line in a template tells VPCART not to display anything on that line if there is nothing in that field.

 

You can call any field from the Categories table in the database in your category template. For a full list of these fields, see page 181.