Develop > Application Configuration > CML primer > Partial templates

Partial templates

While it is best to model the entire configuration file, you can use partial templates to model only part of a configuration file. To create a partial template, you must have a copy of the full configuration file on a server for the template to read. And you must use the Preserve Format option to preserve the rest of the file.

The following shows a simple configuration file.

UserName = alice
Password = pass
HomeDir = /home/alice

To manage only the home directory line, use the @!partial-template instruction and model only the line you want to manage. The template would look like this:

@!namespace=/example/@
@!filename-key=/files/example@
@!filename-default=/usr/example@
@!partial-template@
HomeDir = @homedir;dir@

For more information on the Preserve Format setting, see Setting values in the Value Set Editor. See also The @!full-template and @!partial-template attributes.