Command Reference CIB jsMerge

Functions

include(name, { includeAttributes })

The function include() inserts the template with the specified filename “name” to the resulting document. The filename can contain the absolute path or a path relative to the current working directory. The file extension (e.g. .docx, .odt, .ott) can be omitted. In that case the format of the called template decides which name suffixes are searched for. In the case of ODT, it is also checked for *.odt, *.ott, *.ODT and *.OTT, in the case of DOCX for *.docx, *.docm, *.DOCX and *.DOCM.

For the optional parameter { includeAttributes } a hash-table is expected. The following options are supported within the hash-table:

The option "importPageSettings" controls which Page/Section properties should be applied in the current section of the result document. The following values for "importPageSettings" are possible:

  • "autoHeaderFooter": if headers and footers are defined in the imported template, they will be written to the result document. If no headers and footers are defined, the header/footer definitions of the calling template are used (if defined). Other section or page properties are not copied from the imported template.
  • "all": all section and page properties are copied from the imported template. This value could be used, for example, to concatenate several independent document parts with all their settings.
  • "none": Neither header/footer nor section or page properties will be copied from the imported template. Only the text content is inserted.

If "importPageSettings" is not specified, the default "autoHeaderFooter" will take effect.


Examples:

{# include(“abaustGruss2.odt”)}
{# include(“belehrungstext.odt”)}
{# include(“belehrungstext.odt”, {importPageSettings:”none”})}