Adding Custom Parameters

THESE PAGES ARE STILL UNDER CONSTRUCTION AND DO NOT NECESSARELY REFLECT THE CURRENT VERSION OF TÓPICO

You can send custom parameters to templates by adding them to the collection as a whole or to individual topics.

Sending a custom text parameter to the whole collection

To add a custom text parameter to the whole collection, follow these steps:

  1. Select the Collection tab;
  2. In the Template parameters grid, enter the parameter's name in the Name column;
  3. Enter the parameter's value in the Value column;
  4. Save your collection.

You can now reference this parameter from your custom template.

Tip

Collection wide templates parameters are also used as reusable content snippets as if they were part of the Snippets grid on the Publishing tab.

Example

Tópico user guide collection uses a global template parameter for the software version. This parameter is then used as a text snippet on the Download page and the version number in the header is found in the template, with the following markup.

XSLT
				<xsl:if test="$product_version">
				<xsl:call-template name="product_version"/>
				</xsl:if>
				<!-- product version template -->
				<xsl:template name="product_version">
				<div class="product_version">
				<xsl:text>Version </xsl:text>
				<xsl:value-of select="$product_version"/>
				</div>
				</xsl:template>
			

Sending a custom nodeset parameter to the whole collection

To add a custom text parameter to the whole collection, follow these steps:

  1. Select the Collection tab);
  2. In the Template parameters grid, enter the parameter's name in the Name column;
  3. Enter the parameter's value in the Value column;
  4. Save your collection.

You can now reference this parameter from your custom template.

Sending a custom text parameter to a single topic

To add a custom text parameter to a single topic, follow these steps:

  1. Select the Topic tab;
  2. In the Template parameters grid, enter the parameter's name in the Name column;
  3. Enter the parameter's value in the Value column;
  4. Save your collection.

You can now reference this parameter from your custom template.

THESE PAGES ARE STILL UNDER CONSTRUCTION AND DO NOT NECESSARELY REFLECT THE CURRENT VERSION OF TÓPICO

137 / 194