{"id":1280,"date":"2021-04-29T08:04:35","date_gmt":"2021-04-29T08:04:35","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=1280"},"modified":"2023-04-27T13:56:10","modified_gmt":"2023-04-27T13:56:10","slug":"versioned-template","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=1280","title":{"rendered":"Versioned template"},"content":{"rendered":"\n<p>A versioned template in DocuMotor is essentially a collection of templates that allows the user to keep a version (template) in production while updating e.g., next years template in another version. <\/p>\n\n\n\n<p>The content of versioned templates is restricted to the <a href=\"https:\/\/info.documotor.com\/?page_id=138\" data-type=\"URL\" data-id=\"https:\/\/info.documotor.com\/?page_id=138\">supported templates<\/a>. <\/p>\n\n\n\n<h2>Create versioned templates<\/h2>\n\n\n\n<p>A versioned template is created by accessing the Templates tab for a unit, clicking the button <strong>Create new&#8230;<\/strong>, and selecting <strong>Versioned template<\/strong>, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"901\" height=\"256\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-versioned-template-1.png\" alt=\"\" class=\"wp-image-1209\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-versioned-template-1.png 901w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-versioned-template-1-300x85.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-versioned-template-1-768x218.png 768w\" sizes=\"(max-width: 901px) 100vw, 901px\" \/><figcaption>Create new versioned template<\/figcaption><\/figure>\n\n\n\n<p>A dialog box pops up after clicking on <strong>Versioned template<\/strong>, where the name of the new versioned template is supplied in the <em>Enter new name<\/em> textbox. Press <strong>Ok <\/strong>to create the versioned template.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"495\" height=\"254\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-create.png\" alt=\"\" class=\"wp-image-1208\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-create.png 495w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-create-300x154.png 300w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><figcaption>Dialog box for creating new versioned template<\/figcaption><\/figure>\n\n\n\n<h2>Create versions<\/h2>\n\n\n\n<p>Once a versioned template is created, versions can be created within the collection by accessing the versioned template, e.g., CV Collection above, and clicking the button <strong>Create new version<\/strong>, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"849\" height=\"267\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-version.png\" alt=\"\" class=\"wp-image-1183\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-version.png 849w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-version-300x94.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-create-version-768x242.png 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><figcaption>Create new version within the versioned template<\/figcaption><\/figure>\n\n\n\n<h2>Stages<\/h2>\n\n\n\n<p>Stages are unit-wide. The administration of stages is elaborated upon in the <a href=\"https:\/\/info.documotor.com\/?page_id=736\" data-type=\"page\" data-id=\"736\" target=\"_blank\" rel=\"noreferrer noopener\">Unit Management<\/a> guide. <\/p>\n\n\n\n<p>Existing stages are shown for each version within the collection, as shown below marked with red. <\/p>\n\n\n\n<p>Stages are sorted alphabetically, and new stages will be appended when accessing the versioned template.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"850\" height=\"275\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-1.png\" alt=\"\" class=\"wp-image-1188\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-1.png 850w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-1-300x97.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-1-768x248.png 768w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><figcaption>Stages shown for versions<\/figcaption><\/figure>\n\n\n\n<p>Versioned templates <strong>require<\/strong> that stages are created and assigned to versions within the collection. <\/p>\n\n\n\n<p>An assigned stage is indicated with bold text, which is also shown above, where stage <em>prod <\/em>is assigned to the version <em>CV 2021<\/em>.<\/p>\n\n\n\n<p>Furthermore, a stage can only be assigned to one version at a time. Using the above example, assigning stage <em>prod <\/em>to <em>CV 2022<\/em> will automatically un-assign stage <em>prod <\/em>from <em>CV 2021<\/em> &#8211; as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"850\" height=\"280\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-unassign.png\" alt=\"\" class=\"wp-image-1190\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-unassign.png 850w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-unassign-300x99.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/unit-stages-in-collection-unassign-768x253.png 768w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><figcaption>Stage <em>prod<\/em> switched to version <em>CV 2022<\/em><\/figcaption><\/figure>\n\n\n\n<p><strong>N.B.<\/strong> newly created stages must be manually assigned to a version. Once a stage has been assigned to a version, it cannot be deleted from the management dashboard.<\/p>\n\n\n\n<h3>Assign a stage to a version<\/h3>\n\n\n\n<p>To assign stage a stage to a version, hover over the version to which the stage must be assigned, and click the stage to assign, shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"851\" height=\"269\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-1.png\" alt=\"\" class=\"wp-image-1192\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-1.png 851w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-1-300x95.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-1-768x243.png 768w\" sizes=\"(max-width: 851px) 100vw, 851px\" \/><figcaption>Assigning stage <em>prod <\/em>to version <em>CV 2021<\/em><\/figcaption><\/figure>\n\n\n\n<p>Clicking a stage shows a dialog box. To finalize assigning the selected stage to the selected version, in this example <em>prod <\/em>to <em>CV 2021<\/em>, click <strong>Confirm<\/strong>.<\/p>\n\n\n\n<p>Once confirmed, the stage <em>prod <\/em>will be assigned to version <em>CV 2021<\/em> and removed from version <em>CV 2022<\/em>, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"852\" height=\"291\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-other-version.png\" alt=\"\" class=\"wp-image-1193\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-other-version.png 852w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-other-version-300x102.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-assign-stage-other-version-768x262.png 768w\" sizes=\"(max-width: 852px) 100vw, 852px\" \/><figcaption>Stage <em>prod<\/em><strong> <\/strong>assigned to <em>CV 2021<\/em> and removed from <em>CV 2022<\/em><\/figcaption><\/figure>\n\n\n\n<h2>Generating documents<\/h2>\n\n\n\n<p>DocuMotor supports document generation of versions within a versioned template. Postman and Curl code snippets can be accessed by clicking the code snippet shown below, marked with red.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"847\" height=\"262\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-get-snippet.png\" alt=\"\" class=\"wp-image-1196\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-get-snippet.png 847w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-get-snippet-300x93.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-get-snippet-768x238.png 768w\" sizes=\"(max-width: 847px) 100vw, 847px\" \/><figcaption>Code snippet for versioned templates<\/figcaption><\/figure>\n\n\n\n<p>Generating versioned documents uses the same endpoint as regular documents with two differences:<\/p>\n\n\n\n<ul><li> ID provided is that of the versioned template (parent of the version)<\/li><li>stageId must be added in the header of the call<ul><li>stageId is the ID of the particular stage, see <a rel=\"noreferrer noopener\" href=\"https:\/\/info.documotor.com\/?page_id=736\" data-type=\"page\" data-id=\"736\" target=\"_blank\">Unit Management<\/a> for more<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>If both stageId <em>and<\/em> stageName are provided in the header, only stageId is considered.<\/p>\n\n\n\n<p>With versioned templates, there is no need for the ID of the version when calling DocuMotors <em>generate<\/em> API, as the version ID is located using the ID of the versioned template and the ID or Tag of the stage.<\/p>\n\n\n\n<p>Accessing the code snippet will, as mentioned, provide the user with Curl or Postman code snippets, as shown below.<\/p>\n\n\n\n<p>Existing stages related to the current unit are shown and can be toggled between, to update the calls with new data.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"831\" src=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-snippet-1024x831.png\" alt=\"\" class=\"wp-image-1197\" srcset=\"https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-snippet-1024x831.png 1024w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-snippet-300x243.png 300w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-snippet-768x623.png 768w, https:\/\/info.documotor.com\/wp-content\/uploads\/2021\/03\/versioned-template-snippet.png 1133w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> <strong>N.B.<\/strong> If a stage that is not assigned to any version is selected, the constructed code snippet will not work if used. Make sure to only use code snippets from stages that are assigned to versions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A versioned template in DocuMotor is essentially a collection of templates that allows the user to keep a version (template) in production while updating e.g., next years template in another version. The content of versioned templates is restricted to the supported templates. Create versioned templates A versioned template is created by accessing the Templates tab [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"parent":3160,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1280"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1280"}],"version-history":[{"count":12,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1280\/revisions"}],"predecessor-version":[{"id":5425,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1280\/revisions\/5425"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3160"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}