Template Copying Overview (2024)

Template Copying Overview (1)

Create a template Add placeholders Group variables in dialogs Create regions and rules Customize an interview Upload a template

Template copying is not a recommended or best practice. Instead, you should strive to adapt your template's logic to handle various scenarios that may arise with its use. Copying should be a last resort if you have invested a significant amount of effort adapting your template, but find that you need to revert to an earlier version, and do not want to lose functionality you already created.

Template copying refers to creating a new template by making a copy of an existing template. There is no method for truly copying a template currently; rather, you can use Microsoft Word's Save As feature to save a particular version of a template under another name or at another location. For example, if you have a template that contains content you want to adapt to another purpose, you can either open the template in Word, and use its Save As feature to save the template under another name or at another location.

Be very careful when you use Save As—there is no undo for a Save As action, and if you overwrite another file, you cannot recover any content or data you overwrite.

Overview

If you need to reuse a template in different scenarios, and you want to adapt the content to a different purpose, you can save a version of the template using Microsoft Word's Save As feature. As a basis for understanding the following, you should know that whenever HotDocs opens a template, it also loads all the template properties (stored in the template configuration file) to memory. Similarly, HotDocs loads all the components in the pertinent component file into memory. This means that these elements are all available for running HotDocs Author; these are also the elements saved under another name or to another location when you use Word's Save As feature.

If you create a component, but do not Test or Save your template prior to selecting Save As, the component exists only in memory. That means that when you select Save As, HotDocs saves the component only in the destination, and not at what was the current template.

Common Tasks

Among others, you can copy a template using the following task:

  • Copying a template using Save As

Workflow

When editing a DOCX template, you can use the Save As feature in Word to make a new version of your template. There are three basic options when using the Save As feature in Word:

  • Save a template to the same workspace
  • Save a template to a different workspace
  • Save a template to a folder that is not a workspace folder

Within each of these options however, there are several variations that present different challenges or potential issues you should be aware of.

Whether you click Browse or a Recent Folder, the browse window defaults to the folder of your current workspace. You can then navigate to your desired location from there.

Save a Template to the Same Workspace

When using Save As, if you want to save a version of the template you are editing within the same workspace that contains your original template there are a couple of different scenarios and consequences you should be aware of.

Save a Template as Itself

If you save your file with the same name, nothing changes—this is the same as a regular Save, you are simply overwriting your original file.

Save a Template as a New File

If the save your template under a new file name, HotDocs creates a new template configuration file. The name of the new configuration file is based on the new template file name. The new template's configuration file points to the same component file as the original template.

Save a Template Over an Existing Template File

Overwriting, or saving a version of the original template over an existing template is a little more complex:

If you save your current template as the name of an already existing template in the same workspace as the current template, HotDocs asks if you want to overwrite the existing template. If you choose to do so, both the existing template and its configuration file are overwritten with the content of the new template and its current template properties, respectively. This means that the overwritten configuration file now points to the component file for the template from which you did the Save As. If you created, but did not save a component prior to using the Save As command, HotDocs saves that component to the component file.

Save a Template to a Different Workspace

When using Save As, if you want to save a copy of the template you are editing to a different workspace than the one that contains the original template, there are two possibilities.

Save a Template as a New File

When saving to a different workspace folder, if you save your template under a new file name:

  • HotDocs saves the current template to the new workspace folder.
  • HotDocs creates a new template configuration file in the same workspace folder with the new template. The name of the new configuration file is based on the new template file name.
  • HotDocs writes the current template's components (they are already loaded in memory) into a new component file in the new workspace. If you created, but did not save a component prior to using the Save As command, HotDocs saves that component to the new component file—HotDocs does not save that change to the original component file. If there is an already existing component file with the same name in the new workspace, HotDocs asks if you want to overwrite that component file before overwriting it. There is no Undo for an overwrite.

Save a Template Over an Existing Template File

When saving to a different workspace, if you save your template as an existing file name, HotDocs asks if you want to overwrite that component file before overwriting it. There is no Undo for an overwrite. If you say you want to overwrite the existing template:

  • HotDocs saves the current template to the new workspace folder and overwrites the contents of the existing template.
  • HotDocs writes the current template's properties (already loaded in memory) over those in the existing configuration file in the other workspace.
  • If the destination workspace folder contains a component file with the same name as the one the current template's configuration file points to, HotDocs prompts to ask you if you want to overwrite that component file. If you say yes, HotDocs writes the current template's components (they are already loaded in memory) over the existing component file's contents. There is no undo. If you created, but did not save a component prior to using the Save As command, HotDocs saves that component to the component file—HotDocs does not save that change to the original component file.
  • If the component file for the existing template has a different name than the current template's component file, HotDocs writes the current template's components (they are already loaded in memory) into a new component file corresponding to the name in the current template's configuration file. If you created, but did not save a component prior to using the Save As command, HotDocs now saves that component to the new component file—HotDocs does not save that change to the original component file.

Saving a Template to a Folder that is not a Workspace

Saving a template to a folder that is not a workspace acts as a sort of export. If you use Word's Save As command to save a template to a folder that is not a workspace, the Save As:

  • Saves the template, its configuration file, and its component file to the destination folder. If there are already files in the folder with the same names, HotDocs prompts you to ask if you want to overwrite these files before overwriting them.
  • Detaches the HotDocs custom task panes from the document Saved As. The document now acts as a normal Word document without any HotDocs Author integration.

Cautions and Caveats with Save As

There are many potential issues with using Save As to copy a template. You should avoid doing this if at all possible.

Unintentionally Overwriting a Template or Component File

If you unintentionally overwrite a template or component file, there is no undo—any content you overwrite is simply lost (unless you are using a source control system to back up your templates).

Failed Inserts

When a template has insert fields, Word's Save As feature does not copy those inserted templates along with the parent template. This means that you must copy each of these files for your copied template to work properly. Copying the inserted templates holds just as many hazards as copying the original template does.

Duplicate ID's

Be aware that copying a template creates two templates with identical template IDs. This can lead to template ID conflicts which can impact how you use and access your templates.

Template Copying Overview (2024)
Top Articles
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 6198

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.