Page History
Multiple macros are available to show and hide blocks of content.
- If you want to specify different text for the expand and collapse links, use the combination of Cloak, Toggle Cloak, and Composition macros.
- Otherwise, use the Expand macro. (It is easier to implement.)
Key point for accessibility: Make sure the link text briefly and uniquely describes the hidden content or what the link does, as in the following examples:
- Show
- Hide
Avoid vague link text such as "Click here."
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Expand Macro
You can use the Expand macro to show and hide blocks of content. For examples of the Expand macro in use, try searching for the Expand macro. For instructions, refer to Atlassian help:
https://confluence.atlassian.com/conf613/expand-macro-964960814.html
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Cloak, Toggle Cloak, and Composition Setup Macros
The Cloak
Scrollbar | ||
---|---|---|
|
The {cloak} macro may be used in conjunction with the toggle-cloak Toggle Cloak macro to show and hide blocks of content. In this example, the {toc} macro in the first panel is cloaked. In the second contents panel, the contents are not cloaked. It is not possible to cloak a panel. The markup for the cloaked contents is shown in the last section on this Both must be preceded by the Composition Setup macro.
To enter the Composition Setup macro
Type as much of the following as needed to open the macro browser.
Code Block {composition
- From the list of macros, select Composition Setup.
In the macro panel, enter the parameters. The following code block lists example parameters.
Code Block cloak.toggle.type = text cloak.toggle.open=[show] cloak.toggle.close=[hide]
The Composition Setup macro follows. It is not visible on the completed page.
Composition Setup |
---|
cloak.toggle.type = text
cloak.toggle.open=[show]
cloak.toggle.close=[hide]
|
In this example, a panel encloses a table of contents which may be shown or hidden. The first macro in the panel is the Toggle Cloak macro with the ID TOC. Next is the Cloak macro with the ID TOC. The Cloak macro contains the Table of Contents macro. Thus the Table of Contents macro is cloaked.
Panel | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
To create a page with a table of contents, add your headings and text. Enter the maxLevel equal to the highest numbered heading you want to see in the table of contents and the minLevel equal to the lowest numbered heading you want to see, for example, {toc:maxLevel=4|minLevel=2}. Delete this instruction and any extra headings.
First heading one
Some text.
First heading two
Some level two text.
Second heading two
Second level two text.
Second and last heading one
The markup for the cloaked contents follows.
Code Block |
---|
{composition-setup}
cloak.toggle.type = text
cloak.toggle.open=[show]
cloak.toggle.close=[hide]
{composition-setup}
{panel:title=Contents}
{toggle-cloak:id=TOC}
{cloak:id=TOC}
{toc:maxLevel=4|minLevel=1}
{cloak}
|
To enter the macros
Type as much of the following as needed to open the macro browser.
Code Block {cloak
- When the macro browser opens, select the Cloak or Toggle Cloak macro from the list.
- In the macro dialog box, enter the ID (such as TOC in the example).
- Click Save.
Refer to the ServiceRocket site for documentation of the Composition Setup, Toggle Cloak, and Cloak macros:
- https://docs.servicerocket.com/composition/macro-reference/composition-setup
Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true PageWithExcerpt wikicontent:Exit Disclaimer to Include - https://docs.servicerocket.com/composition/macro-reference/toggle-cloak
Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true PageWithExcerpt wikicontent:Exit Disclaimer to Include - https://docs.servicerocket.com/composition/macro-reference/cloak
Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true PageWithExcerpt wikicontent:Exit Disclaimer to Include
...