### 39.2 Referencing configuration files and templates

To reference a DITA2Go-provided general configuration file or template:

    [Templates]
    Configs = %OMSYSHOME%\path\to\sometemplate.ini

Your DITA2Go distribution includes configuration templates already chained together through references like this; see §39.1.3 Understanding how templates are chained together.

When DITA2Go creates a starting configuration file for a new project, that file includes the first link in the chain. For example, a starting project configuration file for Word output includes this reference:

    [Templates]
    Configs = %OMSYSHOME%\d2g\local\config\local_d2rtf_config.ini

If you want to insert another configuration file (for example, myspecial.ini) in the chain between the project configuration file and local_d2rtf_config.ini, you would copy this reference into myspecial.ini, and replace it with the following reference in the project configuration file:

    [Templates]
    Configs = relative\path\to\myspecial.ini

Make paths to your own configuration files relative to the referencing configuration file. You can chain configuration files together by including in each a [Templates]Configs setting that references yet another template or configuration file. You can have as many referenced files chained as you please; each overrides the one it references, and all others that precede the referenced template in the chain. The most specific configuration rules. See §39.5 Creating your own configuration templates.

Settings that specify paths to configuration templates, or to any other files in the DITA2Go distribution directory structure, should use absolute paths that begin with environment variable %OMSYSHOME%; for example:

    Configs = %omsyshome%\d2g\local\config\local_d2htm_config.ini

If you specify a relative path for any setting in configuration section [Templates], that path is considered to be relative to the configuration file in which the setting occurs.

Precedence of settings

If the same setting has different values in a referenced template or configuration file and in a file that references that template, the value in the referencing file takes precedence, allowing you to override the template when necessary:

- The last referenced file in the chain overrides DITA2Go internal default values.
- A referenced configuration file overrides, in turn, any files it references.
- A document-specific configuration file overrides any files it references, and also overrides any other files the starting project configuration file references
- The starting project configuration file overrides any files it references.

See §42.1.2 Understanding precedence of configuration settings.

Previous Topic: 39.1.6 Understanding how language templates are organized

Next Topic: 39.3 Including document-specific configuration files

Parent Topic: 39. Working with templates

Sibling Topics:

39.1 Working with configuration templates

39.3 Including document-specific configuration files

39.4 Deciding which configuration file to edit

39.5 Creating your own configuration templates

Table of Contents • Index