The {toggle-cloak} macro is used in conjunction with the cloak macro to show and hide blocks of content...
When pages become extremely large, or when there is information that might not always be required, you can use this macro in conjunction with the cloak macro to temporarily hide blocks of content. The user can show or hide cloaked blocks using on-screen navigation provided by the this macro.
Usage
The {toggle-cloak} macro has the following parameters:
{toggle-cloak:id=i|exclusive=v} your content
Parameters
Parameter
Required
Default
Notes
id
The unique ID to assign to a cloak toggle. The cloak macro uses this ID to identify the blocks of content to be shown/hidden.
exclusive
false
By default the cloak-toggle will only affect those cloaked areas with the same ID, however by setting this parameter to true all other pieces of cloaked content at the same level will be hidden as the cloaked content with the matching ID is revealed.
At its most basic level you can toggle a single cloak
{toggle-cloak:id=MyCloakID}Click here to toggle the cloak
{cloak:id=MyCloakID}This content will be cloaked{cloak}
Results in:
Click here to toggle the cloak
This content will be cloaked
Cloak Toggling Multiple Content Blocks
You may many different content blocks on a single page, in this example they all work independantly of one another, in later exmaples you will see how to force only one cloaked area to be visible at a time.
{toggle-cloak:id=CloakID1}Click here to toggle cloak CloakID1
{cloak:id=CloakID1}This content can be cloaked{cloak}
{toggle-cloak:id=CloakID2}Click here to toggle cloak CloakID2
{cloak:id=CloakID2}This content can be cloaked{cloak}
{toggle-cloak:id=CloakID3}Click here to toggle cloak CloakID3
{cloak:id=CloakID3}This content can be cloaked{cloak}
Results in:
Click here to toggle cloak CloakID1 This content can be cloaked
Click here to toggle cloak CloakID2 This content can be cloaked
Click here to toggle cloak CloakID3 This content can be cloaked
The toggles don't need to be next to the cloaks they control - you can put them anywhere, for example:
{toggle-cloak:id=CloakID1a}Click here to toggle cloak CloakID1a
{toggle-cloak:id=CloakID2a}Click here to toggle cloak CloakID2a
{toggle-cloak:id=CloakID3a}Click here to toggle cloak CloakID3a
Cloakable regions:
{cloak:id=CloakID1a}This is content cloaked with ID CloakID1a{cloak}
{cloak:id=CloakID2a}This is content cloaked with ID CloakID2a{cloak}
{cloak:id=CloakID3a}This is content cloaked with ID CloakID3a{cloak}
Which results in:
Click here to toggle cloak CloakID1a
Click here to toggle cloak CloakID2a
Click here to toggle cloak CloakID3a
Cloakable regions:
This is content cloaked with ID CloakID1a
This is content cloaked with ID CloakID2a
This is content cloaked with ID CloakID3a
Multiple Cloak Toggles
You may also have multpile cloak-toggle macros for a single cloaked area.
{toggle-cloak:id=CloakMany}Click here to toggle the cloaked area below
{cloak:id=CloakMany|visible=true}This content can be cloaked{cloak}
{toggle-cloak:id=CloakMany}Click here to toggle the cloaked area above
Results in:
Click here to toggle the cloaked area below
This content can be cloaked
Click here to toggle the cloaked area above
Controlling Other Cloaks
There may be times when you only wish to have a single cloaked area visible, so that as you reveal one area, the others hide themselves
{toggle-cloak:id=CloakExclusive1|exclusive=true}Click here to toggle the cloaked area 1
{cloak:id=CloakExclusive1|visible=true}This is cloaked area 1{cloak}
{toggle-cloak:id=CloakExclusive2|exclusive=true}Click here to toggle the cloaked area 2
{cloak:id=CloakExclusive2}This is cloaked area 2{cloak}
{toggle-cloak:id=CloakExclusive3|exclusive=true}Click here to toggle the cloaked area 3
{cloak:id=CloakExclusive3}This is cloaked area 3{cloak}
Results in:
Click here to toggle the cloaked area 1
This is cloaked area 1
Click here to toggle the cloaked area 2
This is cloaked area 2
Click here to toggle the cloaked area 3
This is cloaked area 3
Hints and Tips
Remember to include the composition-setup macro at the top of your content when using the cloak macro. You should also ensure that you have at least one toggle-cloak macro for each cloaked section of your content so that the user can display that content.
Frequently Asked Questions
None at present.
Issue Tracking
Adaptavist maintain a JIRA Project for tracking bug reports and feature requests for this macro. The currently reported items are shown below:
jiraissues: Could not download[ http://jira.adaptavist.com/secure/IssueNavigator.jspa?view=rss&pid=10036&component=10101&statusIds=1&statusIds=3&statusIds=4&statusIds=5&sorter/field=updated&sorter/order=DESC&tempMax=25&reset=true&decorator=none] : caused by : Circular redirect to 'http://jira.adaptavist.com:80/secure/IssueNavigator.jspa'
Can I link to specific toggles from other pages, I might have my list on one page, and then want a specific cloak to appear according to my choice. A bit similar to using anchors.
Hi Guys,
Can I link to specific toggles from other pages, I might have my list on one page, and then want a specific cloak to appear according to my choice. A bit similar to using anchors.
Is there a way to make an expand all / collapse all button?