The final, and most advanced, way to customize your site is with the page templates. These are the actual pages that generate the content of the store. If you are familiar with ColdFusion and want to modify or add new layouts for the content of the store, this allows you that kind of control. Only experienced developers should use this feature, and be sure to backup the original files before modifying them!
Category and page templates generally use the prefix ‘catcore_’ to designate them as such. This is not a requirement, just a standard used to make it easier to identify templates throughout the code.
The Category & Page Templates list shows the current assigned templates for your store. Click on Edit to change the details for any template or Add New Template to create a new template you can use for your store. For each template enter the following information:
Template Name – The name of the template as referred to on the adminforms.
Parameters – List of parameters that can be optionally defined for the template on store pages, these will be displayed to prompt the user as to what parameters they can enter when using this template. These are useful to be able to use a single template for multiple uses or in different ways.
Template File – The path and file name for this template
Template Type – Defines the type of things the template can be used for. Options include:
a. Products – Only used for category templates, this will display products assigned to the category. Be sure your template has the appropriate code to handle products.
b. Features – Also only for category templates, this will display features assigned to the category. Again, be sure your template has the appropriate code.
c. Used for Categories – This template can be used for category pages and will show up as an option when editing categories.
d. Used for Pages – This template can be used for pages and will show up as an option when editing them.
The store comes with a number of pre-installed templates. These include the following:
category header only – This template is used for category pages that do not have any subcategories, products or features, just text.
sub-categories only – For categories with just sub-categories, no products or features
home page – The template for the home page of the site, it has parameters for outputting various special items, such as the top-level categories, new, on sale, and hot products, and the product of the day.
highlights (new and onsale) – Used to output new and/or onsale products and categories
contact us email form – Used to create a email form page. You can use the parameters for this page to customize the header for this form as well as who it will be sent to. By default the merchant email account for your store will be used. The parameters are as follows:
EmailTo – The email account to send the email to
BoxTitle – The title for the email form
search form – Used to create a site search page
search results page – This is the template page for search results. This page should be hidden on menus, as it is called only from the search form.
products department home – This is designed to be a frontpage for the catalog section of your store. It includes a special section for products assigned to this category (best sellers) as well as a product search box.
products – The basic template for product listing pages. You have a number of optional settings for product.
listing – Determines the layout for the products, either short or vertical
displaycount - Allows you to override the default setting for the maximum products on a page.
ProductCols - Allows you to override the setting for number of product columns.
search_header - Outputs the product count at the top of the page. It will also show any search parameters passed by the product search form.
search_form_header - Displays a search form at the top of the page. You can easily customize which search fields to show in the code.
features – The basic template for feature listing pages. As for products, you can override the default setting for maximum features on a page, as well as display a feature search box.
items on sale – Will display both categories and products on sale. It does not rely on products being assigned to the category, it will display all sale items in the store.
features + products – Use this template if you wish to display products and features on the same category page. You can specify which layout to use for the products.
account directory – This template is used to display the list of retailers carrying your products
sitemap – The sitemap template is used to create a complete listing of products, categories and features in your site. It uses search engine friendly links to make indexing your site easier. You can use the alpha=1 parameter to display an alphabetic search feature on the page (for stores with lots of products).
contact us with file attachment – Basically the same as the contact us email form, but allows the user to include a file attachment. Great for functions like uploading images, resumes, presentations, etc. You can customize the file for what mime types/file extensions to allow. This form requires setting the config.cfm file with a temporary directory to receive uploads, which should be outside your webroot, to protect your site from hack attempts.
A little additional information on parameters and how to use them with your templates. Parameters are entered as a comma delimited list in the form of "aa=bb,xx=yy". These parameter sets will be translated into "attributes.aa = 'bb'" and "attributes.xx = 'yy'" when the page is processed. An interesting result of this is that any variable used in the template such as "displaycount" (the number of items displayed on the page) or any query parameter (hot=1) can be passed as well. Many of the built-in store templates have various parameters that you can set to effect how the page will work.