Writerside Help

Conditional content

Conditional content means you can include or exclude content depending on certain conditions. For example:

  • Audience level

  • Product

  • Version

  • Platform or operating system

  • Output type

In Writerside, you can use filters to specify whether a specific element, like a paragraph, a code snippet, or a screenshot, should or should not be included in a particular version of the documentation. All elements without the filter attribute are included implicitly.

Filter by instance

  • If you want to filter the content by the instance, add the instance attribute to the tag and specify the instance IDs where the content should be displayed. To exclude the element from a particular instance help, add ! with an instance ID. You can add the if tag to select specific portions of content that do not match tags.

    <chapter title="Go to Declaration"/> <p> Place the caret at the desired symbol and press <shortcut key="GoTo"/>. </p> <p instance="ab,cd"> Alternatively, keeping <if instance="ab"> <shortcut>Ctrl</shortcut> (<shortcut>⌘</shortcut> for macOS) </if> <if instance="cd"> <shortcut>⌘</shortcut> </if> pressed, hover your mouse pointer over the symbol. </p>
    ## Go to Declaration Place the caret at the desired symbol and press <shortcut key="GoTo"/>. Alternatively, keeping <if instance="hi"> <shortcut>Ctrl</shortcut> (<shortcut>⌘</shortcut> for macOS) </if> <if instance="cd"> <shortcut>⌘</shortcut> </if> pressed, hover your mouse pointer over the symbol.

Filter by custom conditions

You can filter the content by other custom conditions.

For example, if you have content that is only relevant to macOS users, you could set a filter with the OS name.

Then include the content if you are publishing a Mac user guide or exclude it if you are publishing a Windows user guide.

  1. Add the filter attribute with the value macos to the semantic elements to filter the whole element.

    <procedure title="Setting up" id="settings"> <step filter="macos">Step one</step> <step filter="win">Step two</step> </procedure>
  2. Or wrap the content fragment to the if element to filter a part of the content.

    <li> Start typing to filter results. <if filter="macos"> If necessary, press <shortcut>⌘+F</shortcut> to clear the filtering. </if> <if filter="win"> If necessary, press <shortcut>Ctrl+F</shortcut> to clear the filtering. </if> </li>
    1. Start typing to filter results. <if filter="macos">If necessary, press <shortcut>⌘+F</shortcut> to clear the filtering.</if> <if filter="win"> If necessary, press <shortcut>Ctrl+F</shortcut> to clear the filtering.</if> 2. This a step is for all OSs.

Filter reusable content

  1. To include only certain parts of the original topic, use the include tag with the use-filter attribute in your topic.

    <include from="lib_settings.xml" element-id="prerequisites" use-filter="macos">
  2. Or add the include element to the .tree file of your product with the use-filter attribute.

    <include from = "toc_chunks" target = "settings" use-filter = "linux"/>
Last modified: 28 July 2023