Home Search

DriveWorks Pro 22
How to: Create a Document Template

Send Feedback

How to: Create and Install a Document Template

Document Templates in DriveWorks provide easily customizable branding that can be edited and distributed throughout Projects. For example, if a marketing department decided to rebrand everything within a company (name, UI or logo) then updates and edits would only need to be made once (in the original Document Template) for changes to be reflected across all Projects that use that specific template. They can be useful for managing a multi-user implementation.

The file extension for Document Templates is .drivedot
Documents are declared in XML where you will need to specify the name of the Document, schema and all its Properties.

Document Templates need to contain all relevant master documents, reference images and any other additional files to display a description in the 'Create Document...' wizard.

Create a Document Template

Follow the steps below to create a Document Template :

  1. Create a TemplateName folder (Content Folder).
    The folder name and XML name (created in step 3) must match for the Template to register in DriveWorks.
  2. Create a Description folder containing an "index.html" file
  3. Add the TemplateName.xml file to the Content Folder.
  4. Place any required images or master document files in the Content Folder.
  5. Update "index.html" to reflect your template.
  6. Modify "TemplateName.xml" to contain the necessary information.
  7. Create a zip of the above files and folders.
  8. Change the extension to .drivedot.

Examples

The examples below demonstrate how xml/html files are converted in DriveWorks.

Email


 <!-- Document -->
<Document Name="{Name}" Type="Email">
    <From><Rule>="MyEmailAddress"</Rule></From>
    <To><Rule>="YourEmailAddress"</Rule></To>
    <Cc></Cc>
    <Bcc></Bcc>  
    <Subject><Rule>=" Your Email Document Template Subject"</Rule></Subject>
    <Attachments><Rule>=FSGetFullPathProject("{Name} Your Email Document Template Name\Logo.png")</Rule></Attachments>
    <PreventOutlookNewlineRemoval>False</PreventOutlookNewlineRemoval>
    <SendAsHTML>True</SendAsHTML>
    <Body><![CDATA[
        <!DOCTYPE html>
        <html>
            <head>
                <title>Your Email Document Template Title</title>
                <style>
                    body (
                        font-family:"Calibri",sans-serif;
                    }
                </style>
            </head>
            <body>
                <p>Hi</p>
                <p>Your Email Here</p>
                <p>Kind Regards</p>
                <p><span style="color: #C00000; margin-bottom: 0;"><strong>DriveWorks Support Team &#8211 </strong></span><span style="color: #7F7F7F;
                <p>DriveWorks Ltd | Configure & Automate </p>
                <p>---------------------------------------------------------------------</p>
                <p>T: <strong> + 44 1925757585 </strong> | T: USA <strong> 978 633 3230 </strong> </p>
                <p>E: </span>support@driveworks.co.uk</p>

                <span style="color: #C00000; margin: 0">www.driveworks.co.uk</span></p>
                <img src="Logo.png" alt="DriveWorks Logo">
            </body>
        </html>
    ]]></Body>
</Document>

Excel

<!-- Document -->
<Document Name="{Name}" Type="ExcelDocument"
    MasterDocumentPath="{Dir:BasePath}ExcelDocument.xlsx"
    FileNameRule="=&quot;{Name} &quot; &amp; DWSpecification &amp; &quot;.docx&quot;"
    DocumentPathRule=""
    IsHidden="False"
    CreateHtml="False"
    IsHtmlFileHidden="False"
    CreatePdfFileHidden="False">
    <NamedRanges>
        <NamedRange Name="Cell">
            <Rule>="Placeholder"</Rule>
            <Comment></Comment>
        </NamedRange>
    </NamedRanges>
</Document>  

Word

<!-- Document -->
<Document Name=" {Name} " Type="WordDocument"
    MasterDocumentPath="{Dir:BasePath}WordDocument.docx"
    FileNameRule=""{Name} " & DWSpecification & ". docx""
    DocumentPathRule=""
    IsHidden="False"
    CreateHtml="False"
    IsHtmlFileHidden="False"
    CreatePdf="False"
    IsPdfFileHidden=="False"
    <Bookmarks>
        <Bookmark Name="Bookmark">
            <Rule>="Placeholder"</Rule>
            <Comment></Comment>
        </Bookmark>
    </Bookmarks>
</Document>    

Simple XML

<!-- Document -->
<Document Name="{Name}" Type="XmlDocument"
    XmlPath="{Dir:BasePath}XMLDocumentSimple.xml"
    FileNameRule="=&quot;{Name} &quot; &amp; DWSpecification &amp; &quot;.html&quot;" 
    DocumentPathRule=""
    IsHidden="False">
    <Rules>
        <ElementRule ElementRef="Field1">="Field Placeholder"</ElementRule>
    </Rules>
</Document>

Advanced XML

<!--Document -->
<Document Name="{Name}" Type="AdvancedXmlDocument"
    XmlPath="{Dir:BasePath}XMLDocumentAdvanced.xml"
    FileNameRule="= &quot; XMLDocumentAdvanced &quot; &amp; DWSpecification &amp; &quot;.html&quot"
    DocumentPathRule=""
    IsHidden="0">
    <Rules>
        <ElementRule ElementRef="Cubes/Cube/Height">="Height Placeholder"</ElementRule>
        <ElementRule ElementRef="Cubes/Cube/Width">="Width Placeholder"</ElementRule>
        <ElementRule ElementRef="Cubes/Cube/Depth">=DWVariableCreated </ElementRule>
    </Rules>
</Document>

<!-- Variables -->
<VariableCategory Name="VariableCategory1">
    <Variable Name="Created">=TEXT(TODAY(), "DD MMMM YYYY")</Variable>
</VariableCategory>
     

Uninstall a Document Template

To uninstall a Document Template please follow the steps below:

  1. Open File Explorer and navigate to the folder where "Templates" are stored in DriveWorks.

    Local Disk>ProgramData>DriverWorks>[Version Number]>Templates>Documents

  2. From the "Document" folder, select the template you want to uninstall.
  3. Right-click and select "Delete" or press the "Delete" key on your keyboard.

The deleted Document Template will be removed.