Customizing Template
You may
want to change the layout of the output files, adding your logo, images, links, etc. If you are a developer, you may also want to add you own codes. Templates of our products are fully customizable, you can start from the default template shipped with the product and then build a template of
your own.
Important Notes:
- Customizing templates requires necessary knowledge in the related Web technologies and HTML. Some codes may involve JavaScript also.
- Since the code generator relies on various Template Tags inside the templates to generate the correct codes, you should familiarize yourself with them first. See Template Tags for details.
- Since the Template Tags uses VBScript, you need to know the scripting language also.
- You should use an editor that will not unexpectedly alter or delete the Template Tags. Otherwise incorrect result may occur.
Location of Unzipped Template Files
To generate output files, the code generator first unzips the template to the subfolder \<product name>\Templates\<template name> under your My Documents folder. If you have not generated any files yet, do once first. Then you can modify the unzipped files under subfolder named "Script" directly.
For example, if the template archive is named as "default.zip", it will be unzipped to the folder C:\Documents and Settings\<user name>\My Documents\<product name>\Templates\default.zip\ in Windows XP, you can modify files under the subfolder "Script".
Note: The customized files will not be zipped back to the template archive automatically. It you want to transfer or share your template, you need to zip the template files back to a template archive yourself. When you zip the template files, make sure you zip the files and subfolders in the unzipped folder, not the unzipped folder itself. Otherwise there will be one level different.
Using above example, you should add the files and subfolder under C:\Documents and Settings\<user name>\My Documents\<product name>\Templates\default.zip\ to the template archive, not the whole folder.
When a version change is detected, the code generator will ask you to confirm overwriting the old unzipped version, you should answer carefully, especially if you've implemented some customizations previously. Always back up your customized template first!
Template Files
The code generator parses the control file named "control.xml" and assembles the output files using the code snippets from the template files as input files. If you want to add an output file, you need to add a <control> tag in the control file; if the file is to be included in other file(s), you need to add <session> tags in control.xml also. See Control File for details.
Subfolders
If you add new subfolders (e.g. you may want to add an "images" subfolder), you need to add a <control> tag in the control file.
Language File (if applicable)
If a language file named "lang.xml" is found in the template, the default one under the subfolder "src" of the installation folder will not be used. A language file contains all the wordings in the template. If you want to translate a template, this is the only file you need to translate. This file must be named as "lang.xml" or the default language file will be used.
Also See:
Control File
Template Tags
Template Object Properties
Using User Code
|