Configuring New File Templates

Describes how to create a set of document templates that the content authors will use as a starting point for creating books and articles.

Each Document Type Association can point to a directory, usually named templates, that contains the file templates. All files found here are considered templates for the respective document type. The template name is taken from the file name, and the template type is detected from the file extension.

  1. Go to your custom framework directory ([OXYGEN_INSTALL_DIR]\frameworks\[CUSTOM_FRAMEWORK_DIR]) and create a directory named templates.
    The directory tree of the documentation framework should be something like this:
  2. In the templates directory, create two files. A file for the book template and another one for the article template.
    An example for the Book.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <book xmlns="" 
        <title>Book Template Title</title>
            <title>Section Title</title>
            <para>This content is copyrighted:</para>

    An example for the Article.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    You can also use editor variables in the content of the template files and they will be expanded when the files are opened.
    Note: You should avoid using the ${cfd},${cf},${currentFileURL}, and ${cfdu} editor variables when you save your documents in a data base.
  3. Open the Document Type configuration dialog box for your custom framework and click the Templates tab. In the Templates directory text field, introduce the ${frameworkDir}/templates path. It is recommended that all the file references made from a Document Type Association to be relative to the ${frameworkDir} directory. Binding a Document Type Association to an absolute file (e. g.: C:\some_dir\templates) makes the association difficult to share between users.
  4. To test the templates settings, go to File > New to display the New document dialog box. You should see the new templates in the folder for your custom framework (in the Framework templates section). The names of the two templates are prefixed with the name of the framework. Selecting one of them should create a new XML file with the content specified in the template file.