Inserted Templates and Shared Component Files

When you insert one template's contents into another template's document assemblyThe process HotDocs goes through as it processes scripts in the template and merges answers into the document produced from the template. At the end of the assembly process, the user has a document tailored to his or her needs. process, you may or may not want both templates to share component files.

INSERT instructions inside a SPAN fieldA place in the template that denotes where users' answers should be merged, or where a specific instruction should be executed. In a text template, a field is denoted by chevrons. In a form template, a field is denoted by a colored box that is overlaid on the form's static text. will only work if the parent template and the inserted template use the same shared component file.

Manual Sharing of Component Files

When you insert an existing templates contents, HotDocs does not automatically apply the component file of the main (parent) template to the inserted (child) template. By default, when HotDocs processes the INSERT instructionAn instruction that inserts one template into another. For example, if boilerplate text needs to be used in multiple documents, a template An instruction that inserts the contents of one template into another. For example, if you have boilerplate text you need to use in multiple documents, you can create a template that contains that text and use the Insert intruction in each template that requires the boilerplate text to insert that content. This way, if you need to make a change to the text, you only need to update one template. during assembly, it uses the inserted template’s own component file. It is often the case that the child template contains variables and other components not found in the component file of the main template, and the reverse is also often true.

On the other hand, related templates often share many of the same variables. If you want an existing child template to use the same component file, you must manually make the child template share the parent template’s component file. In addition, if the inserted template already contains variables, dialogs, and so forth, you must copy those existing components into the shared component file.

Automated Sharing of Component Files

When you select text within a template and make that text into a new template, as long as you save the new template in the same folder as the parent template, HotDocs automatically points the child template to the parent template's component file. This ensures the parent template and the inserted child  template continue to share a common set of variables and other components.

However, if you save the inserted child template to a different folder than the parent template's, HotDocs creates a new, empty component file. If the text you used to create the new template contains variableA component that is used to represent changeable text (such as names, dates, numbers, etc.) in the template. Types of variables include Text, Date, Number, True/False, Multiple Choice, Computation, and Personal Information.s, you must copy the pertinent components from the parent template into the new component file.

If you later realize the two templates should stop sharing component files, you can point the two templates to separate component files.