Template descriptor file

Each publishing template includes a descriptor file that defines the meta-data associated with template. It is an XML file that defines all the resources included in a template (such as HTML page layout files, CSS, JS, fonts, and transformation parameters).

The template descriptor file must have the .opt file extension and must be located in the templates' root folder.

A template descriptor might look like this:

<publishing-template>
     <name>Flowers</name>
				
     <webhelp>
         <tags>
             <tag>tree</tag>
             <tag>light</tag>
         </tags>
      <preview-image file="flowers-tree.png"/>
				
      <!-- Resources (CSS, favicon, logo and others) -->
      <resources>
         <!-- Main CSS file -->
         <css file="flowers.css"/>
				
         <!-- Resources to copy to the output folder -->
         <fileset>
             <include name="resources/**/*"/>
             <exclude name="resources/**/.svn"/>
             <exclude name="resources/**/.git"/>
         </fileset>
      </resources>
				
      <parameters>
         <parameter name="webhelp.show.main.page.tiles" value="no"/>
         <parameter name="webhelp.show.main.page.toc" value="yes"/>
         <parameter name="webhelp.top.menu.depth" value="3"/>
      </parameters>
    </webhelp>
</publishing-template>
Tip: It is recommended to edit the template descriptor in Oxygen XML Editor/Author because it provides content completion and validation support.

Template Name and Description

Each template descriptor file requires a name element. This information is displayed as the name of the template in the transformation scenario dialog box.

Optionally, you can include a description and it displayed when the user hovers over the template in the transformation scenario dialog box.

<publishing-template>
    <name>Lorem Ipsum</name>
    <description>Lorem ipsum dolor sit amet, consectetur adipiscing elit</description>
    ...

Template Author

Optionally, you can include author information in the descriptor file and it displayed when the user hovers over the template in the transformation scenario dialog box. This information might be useful if users run into an issue or have questions about a certain template.

If you include the author element, a name is required and optionally you can include email, organization, and organizationUrl information.

<publishing-template>
    ...
    <author>
      <name>John Doe</name>
      <email>jdoe@example.com</email>
      <organization>ACME</organization>
      <organizationUrl>http://www.example.com/jdoe</organizationUrl>
    </author>
    ...

Webhelp Element

The webhelp element contains various details that define the WebHelp Responsive output. The elements that are allowed in this webhelp section specify the template tags, template preview image, resources (such as CSS, JS, fonts, logos), HTML page layout files, transformation parameters, HTML fragment extensions (used to add fragments to placeholders), or XSLT extensions.

    <webhelp>
        <tags>
          ...
        </tags>
        <preview-image file="MyPreview.png"/>
					
        <resources>
          ...
        </resources>
					
        <html-page-layouts>
          ...
        </html-page-layouts>
	 				
        <parameters>
          ...
        </parameters>
    </webhelp>

Template Tags

The tags section provides meta information about the template (such as layout type or color theme). Each tag is displayed at the top of the Templates tab window in the transformation scenario dialog box and they help the user filter and find particular templates.

<publishing-template>
    ...
    <webhelp>
      <tags>
      <tag>tree</tag>
      <tag>dark</tag>
    </tags>

Template Preview Image

The preview-image element is used to specify an image that will be displayed in the transformation scenario dialog box. It provides a visual representation of the template to help the user select the right template. The image dimensions should be 200 x 115 pixels and the supported image formats are: JPEG, PNG, or GIF.

You can also include an online-preview-url element to specify the URL of a published sample of your template. This will display an Online preview icon in the bottom-right corner the image in the transformation scenario dialog box and if the user clicks that icon, it will open the specified URL in their default browser.
<publishing-template>
    ...
    <webhelp>
      ...
      <preview-image file="ashes/ashes-tree.png"/>
      <online-preview-url=https://www.example.com/samples/tiles/ashes</online-preview-url>