---
title: "Create reusable sub templates"
description: "Generate documents by combining multiple reusable sub templates."
canonical_url: "https://resources.docmosis.com/template-tutorials/master-sub-templates"
last_reviewed: 2026-06-12
---

# Create reusable sub templates

Templates can be combined into one resulting document, allowing content that appears in multiple documents to be separated out into a "shared" or common template.

NOTE: This example relies on multiple template files, which can be found in the ***"MasterSubTemplates.zip"*** download above.

### Direct referencing

A child/sub template may be inserted into a parent/master template by directly naming the child template inside the parent template using the "ref:" instruction, like this:

\<\\>

Docmosis will look for the "template1\.doc" template in the "common" folder.  The path to the child template should be given relative to the location of the parent template. Docmosis will insert the content from "template1\.doc" at the position of the \<\\>

This will insert the template whose filename is in the data element "templateName".

# Create reusable sub templates - related json data

```json
{
  "subTemplateName": "Sub2.docx",
  "exampleDataOne": "This piece of data is used in the first subTemplate",
  "exampleDataTwo": "This piece of data is used in the second subTemplate"
}
```

# Create reusable sub templates - example template syntax

```docmosis
**Sub Template 2**

Fields may also be used in the sub templates like so:

\<\\>
```