Configure Templates

Contents  Previous  Next

 

Menu: Configure > Templates

 

Default Shortcut Key: none

 

Macro function: ConfigureTemplates()

 

The Configure Templates command is used to create or edit Templates: user-defined text blocks which can be inserted into any text file from a pop-up selection menu.  Once Templates have been defined, they can be inserted with the Templates command.

 

Templates are often used by programmers for defining the control structures of a programming language so that they can later be entered more quickly and without the chance of a typing error.  The use of Templates, however, can be extended to facilitate the entry of any text, such as address blocks, copyright notices, phone numbers, part numbers, etc.

 

Template Sets and Templates are defined using the following dialog box:

 

ConfigureTemplates

 

Templates may consist of one or more lines of text with any formatting or indenting you choose.  In addition, the template can dictate the placement of the text cursor, or how selected text should be used:

 

Text Cursor Placement

The Vertical Rule character (|) can be placed within a Template to dictate where the text cursor should be placed within the Template following its insertion.  This allows, for example, programming code blocks to be defined in which the text cursor is placed between a pair of parentheses, ready for additional code to be typed.

 

Operating on Selected Text

The caret or circumflex character (^) can be placed within a Template to indicate that the template should operate on a text selection.  A pair of examples will help to illustrate the power of this feature:

 

Example 1:

The template <B>^</B>| would cause the current text selection to be surrounded with HTML bold tags.  The text cursor would be placed at the right of the closing bold tag.

 

Example 2:

The following Template:

 

<html>

<head>

|

</head>

<body>

^

</body>

</html>

 

could be run after using the Select All Text command to select the entire file.  The effect would be to add the required HTML tags that help make an ordinary text file ready for viewing on the Internet.  The text cursor would be place between the <head> and </head> tags, awaiting a title for the document.

 

Unindenting within a Template

If you need to unindent within a defined Template, use the tilde character (~) to designate the point at which the Backspace command should occur.  The tilde will not be recognized in this way unless the Insert as if typed from the keyboard option is in force (see below).

 

Template Sets

A Template Set is a collection of Templates.  Up to 100 Template Sets can be defined.  Up to 500 Templates can be defined within any Template Set. 

 

New

Use the New button to define a new Template Set.  A pop-up dialog will appear into which the name of the Template Set is entered.

 

Rename

Use the Rename button to change the name of an existing Template Set.

 

Copy

Use the Copy button to make a copy of the currently selected Template Set.

 

Delete

Use the Delete button to delete the currently selected Template Set.  A confirmation is required before the deletion occurs.  If a Template Set is accidentally deleted, you can recover it by using the Cancel button.

 

Close Template window after insertion

Use this option to dictate whether or not the Template window should be closed after a Template is inserted into the edited text.  Note that this option is maintained separately for each Template Set, permitting a different behavior to be defined as needed for different Template Sets.

 

Insert as if pasted from a Clipboard

Use this option if you prefer that Templates from the current Template Set be inserted into the text stream as if they had been pasted from a Clipboard.  When this option is selected, the Autoindent setting will not influence the indent level of template text.  Note that this option is maintained separately for each Template Set, permitting a different behavior to be defined as needed for different Template Sets.

 

Insert as if typed from the keyboard

Use this option if you prefer that Templates from the current Template Set be inserted into the text stream as if they had been typed from the keyboard.  When this option is selected, the Autoindent setting will influence the indent level of template text, if the Template is inserted on an indented line.  Note that this option is maintained separately for each Template Set, permitting a different behavior to be defined as needed for different Template Sets.

 

If you need to unindent within a defined Template, use the tilde character (~) to designate the point at which the Backspace command should occur.  The tilde will not be recognized in this way unless the Insert as if typed from the keyboard option is in force.

 

Templates

New

Use the New button to define a new Template.  First, a dialog box will be presented to get the name of the new Template.  Then an editing window will appear into which the Template text can be typed.

 

Rename

Use the Rename button to change the name of an existing Template.

 

Edit

Use the Edit button to edit the content of an existing Template.

 

Delete

Use the Delete button to delete the currently selected Template.  A confirmation is required before the deletion occurs.  If a Template is accidentally deleted, you can recover it by using the Cancel button.

 

 

bm2Boxer's Template information is stored in the file Template.ini, and its format is that of a simple text file, not a binary file.

 

bm1If you need to insert one of the special characters (| or ^) into a template in its textual form, use either || or ^^.  If you need to insert the special character ~ into a template, use \~.

 

bm1If the need arises to insert a single character which is not easily typed from the keyboard, consider using the Insert Symbols feature rather than defining a single character Template.  The Insert Symbols feature permits a defined character to be entered using a single keystroke.