Template Files

Template files allow you to create boilerplates for various file types. For example, if you were working on a particular web project you might have just 2 or 3 page layouts that you use where only the content is different. In this case it would save a great deal of effort if you could create a new file with all of the markup done so you only had to enter the actual content.  
 
PSPad allows you to have any number of different template files for any file type.  
 
How do I create a template?  
Simply open a new file and save it in the /Templates directory with the correct file extension. You can save your template with any (legal) name you like but if you create a template with the name 'default' then each time you create a new file based on that file type a copy of your template will be used.  
 
Example - Creating a default template for JavaScript files:  
Create a new text file.  
 
Enter the following text:  
 
/* ******************************************* */  
/* File Name:                                  */  
/* Author:                                     */  
/* Description:                                */  
/* ******************************************* */  
 
Save the file as default.js in the /Templates directory (there may be one in there already so rename it before saving your own).  
 
Now, select the File / New menu option and choose 'New File' and 'JavaScript' from the dialog box. The system will create a file called something like 'New1.js' and the file will contain the text that you entered in to the template.  
 
How do I use a template other than the default one?  
Each file type with at least one defined template is included on the tree view that is displayed when you select the File / New menu option and click on the Use Template' radio button (see below).  
 
usetemplate  
 
Simply double-click on the template you require and it will be loaded.  
 
Remember: The name you save your template file with will be what is displayed in the dialog box show above, so try and give your files meaningful names.  
 
At the bottom of the dialog, you will see a checkbox marked 'File name same as Template name'. Normally PSPad creates file with a name like 'New1' with the relevant extension. If you check this box then the file name will be the same as the template name, so, for example, if you checked the box and then double clicked on the 2nd entry in the HTML template list, your file will be called glossary.html.