Screen: ShopSite > Merchandising > Custom Templates

Creating Custom Template Include Files

Custom template include files are an easy and convenient way to modularize your custom template code. You simply save a piece of code -- from one line to as much as you want -- as a separate file, then use an [-- INCLUDE filename --] tag where you want to place that code in your template. You can use include files for several purposes:

To Create an Include File:

A custom template include file can be any chunk of code that you want, small or large. You can create your own, or use any of the built-in ShopSite include files.

1. Plan and Develop Your Custom Template

It’s usually easier to create include files after you’ve planned a custom template, and possibly after you’ve created most of the code. Once a template is planned, you can identify sections where it would make sense to use an include file, such as:

2. Study the Example

The example shows how to use an include file for a Cascading Style Sheet that is going to be applied to many pages. It also lists all of the built-in ShopSite include files and information that you need to know to use them.

3. Create The Include Files

Using include files is a two-part process. You must create the include files themselves, and put [-- INCLUDE filename --] tags in your templates where you want to place the contents of the include files.

If you want to create an include file from a piece of your existing code, simply copy the code and paste it into a new include file. Then replace the code in your template with an [-- INCLUDE filename --] tag.

4. Upload The Include Files

Once you have your templates and include files complete (or at least ready for testing), you need to upload them to your store. To upload include files:

  1. From the ShopSite back office, click on Merchandising > Custom Templates.
  2. On the Custom Templates screen, click Upload Template in the Include Files section.
  3. Use the Browse button to locate your template, then click Upload File to upload the include file to your store.

You can also use FTP to upload include files to the correct directory. Keep these points in mind:

5. Test Your Template

Since an include file is not a stand-alone piece of code, you test an include file by testing the template that references it. Follow the test procedure for the appropriate template type.


ShopSite Help and Resource Center
Give Feedback


ShopSite Shopping Cart Software