Like creating new Template via user Interface its possible to create new Template by writing definition.xml file command/tag that instruct CJT to create new Template.
Templates must be defined first before Blocks. Linking Block to Templates is not being created yet would cause the package installer to fail.
Creating Template can be done by using <object> tag. object tag with Type=’template’. It would instruct CJT to create new Template by using the fields laying between <object></object> tags.
<object type="template"> TEMPLATE FIELDS GOES HERE... ..... ..... ..... </object>
Basic Template Data
Template Data is what defining the Template, the basic Data Field is currently name, type, description and code. They can defined as following:
<object type="block"> <name>TEMPLATE-NAME</name> <description></description> <type>TEMPLATE_TYPE</type> <code>[RAWDATA] or [CODEFILE]</code> </object>
Code data can be raw or point to file. Raw data must be presented inside CDATA section as following. Please note that name is very important as its what is used to link Template to Blocks.
In many situation specially when Block Code is huge, its better to add Block Code in external file as following