Writerside Help

Make part of the reused content differ

To make the content differ in different includes, you can use variables and filters.

Refer to the instance name

  • Use the Writerside variable in the warning content to refer to the instance name:

    <snippet id="generic_warning"> <warning>This version of %instance% support ended on January 14, 2021. Download the latest version.</warning> </snippet>

Use a variable with the version number

  1. Declare the variable inside the snippet you want to reuse.

    <snippet id="generic_warning"> <warning>This version of %instance% support ended on January 14, 2021. Download the %latest% version.</warning> </snippet>
  2. In the target topic use the var tag and specify the name and value attributes. <include from="warning_libraries.topic" target="generic_warning"> <var name="latest" value="1.7"/>

Display warning for all instances except one

You can specify the instance in which an element should or should not display.

  1. Add the instance attribute to the warning tag, use ! symbol and specify the ids of the instances where this warning should not be displayed.

    <warning instance="!sd">This version of product support ended on January 14, 2021. Download the latest version.</warning>
  2. You can add the if tag to select a specific fragment of content.

    <warning instance="!sd"><p>This version of product support ended on January 14, 2022.</p> <p if instance="ac">Download the latest version <a href="link1">here</a>.</p> <a if instance="!ac">Download the latest version <a href="link2">here</a>.</p> </warning>

For more information about variables and filters, refer to the specified sections.

Last modified: 19 April 2024