Inserted Templates and Shared Component Files
When you insert one template's contents into another template's document assembly process, you may or may not want both templates to share component files.
INSERT instructions inside a SPAN field 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 instruction 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 variable 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.