A toggler is a feature that lets users click a hotspot to reveal one or more named elements in a topic. A named element (also called the "toggler target") is a chunk of content that can reside anywhere in the topic. When users click the toggler hotspot, the output reveals hidden content elements. When users click the hotspot again, the content is hidden again.
We have assigned a toggler element to this paragraph. Select the "Click Me" hotspot text below to hide this paragraph. Then click the hotspot again to show the paragraph.
- Open the content file.
- Click anywhere in the paragraph that you want to toggle (the content that will open when users click the hotspot).
Select the Home ribbon. In the Attributes section, select Name.
The Manage Named Elements dialog opens.
- Type a name for the toggled element (anything that will help you identify it).
- Click OK. The named element is added, with a yellow flag next to it. The flag will not display in the output. It is simply used to show you where a named element has been inserted. You can hide or show this flag by selecting the option from the Show tags button in the XML Editor local toolbar.
- In the topic, highlight the text that you want to use as the toggler hotspot.
Do one of the following, depending on the part of the user interface you are using:
- Ribbon Select the Insert ribbon. In the Text section, select Toggler.
- Tool Strip Select Insert > Toggler.
The Insert Toggler dialog opens.
- In the Toggler targets section, click the check box next to the toggler element that you created.
- (Optional) In the Toggler class section, select a style class to be associated with the toggler.
Click OK. The toggler hotspot now has the toggler icon next to it in the XML Editor. (The icon will not display in the output. It is simply used to show you where a named element has been inserted.)
- Click to save your work.