Writerside Help

Switchable content

To add larger pieces of switchable content to the page, use switcher-key tag. This is an alternative to Tabs.

For example, if a feature's description is different for Windows and macOS, you need to provide it for each platform individually in the topic, or if in general documentation is the same, but you need to provide examples in different languages or frameworks.

Create switchable content

  1. Add the switcher-key attribute to the elements that should appear when the user selects a certain switcher on top of the page.

  2. (Optional) Add the switcher-label attribute to the topic tag in XML or use front matter in Markdown if there is an entity that sections describe. For example, operating system, programming language, technology and so on.

Use the switcher at the top of the page to switch chapters in the example below:

Section switcher
<topic title="Topic title" switcher-label="Custom label"> <chapter title="Section One" switcher-key="Section One"> <p>The content that should appear when the Section One is selected.</p> </chapter> <chapter title="Section Two" switcher-key="Section Two"> <p>The content that should appear when the Section Two is selected.</p> </chapter>
--- switcher-label: Custom label --- # Topic title ## Section One {switcher-key="Section One"} The content that should appear when the Section Once is selected. ## Section Two {switcher-key="Section Two"} The content that should appear when the Section Two is selected.
Last modified: 28 July 2023