projectdoc Toolbox

Shows how to use the Wiki Link Macro based on Remote Controls to alternate between two different views on a single document.

Audience
Type
Level of Experience

Remote controls allow to override macro parameters with HTTP request parameters. This way a view on a document can be altered. For instance a release notes document could show changes in a condensed form. By providing a link to override the parameters of the macro displaying the changes, the view could expand the information on each change. Since version 4.5 of the projectdoc Toolbox for Confluence the Wiki Link Macro allows to toggle between the two states.

This tip shows how to configure the Display Table Macro and Wiki Link Macro to create two views on a document.

Use Case

For this tip we want to show you a live example with a list of macros from the projectdoc Toolbox. We show them in a short overview and in an expanded version.

Configuration Display Table

To make the Display Table Macro ready to be remote controlled, the Identifier parameter needs to be set.

You can also use the Identifier Classes parameter in case you need to control a selection of macros in a single action. 

Configure your query with the Select, Where and Sort By parameter according to your use case. For our example we just select the macro documents tagged with Remote Controller of this space.

Configure Wiki Link Macro

The Wiki Link Macro allows to add Remote Controls with the Request Parameters parameter.

The following controls alter the selected information, switch to the section render mode, and render the section title as link to the macro document.

list-of-macros:select=Name, Short Description, Description,Tags|&
list-of-macros:render-mode=*s&
list-of-macros:render-heading-as-link=true

Since the Wiki Link Macro refers per default to the current document, when clicking the link, the view will be expanded to the section view. Therefore we set the label of the link to Details View and add an appropriate tooltip.

Now we do the same for the toggle state. Besides the label and tooltip for the toggle state the next screenshot also shows the request parameters we set before.

By specifying a Request Toggle Label and by providing Request Parameters the Wiki Link Macro provides a toggle mode.

You may want to deselect the styling options, since these options are not relevant for self-referencing links.


Wrap Buttons

You probably do not want to print the toggle link when exporting the page to PDF.

To do so wrap the Wiki Link Macro inside a Content Marker Macro.


Use the Pretend Being A space property to hide the content area in case the property is set to printer.

Live Example

Here is the live example showing the macros provided by the projectdoc Toolbox.

Resources

Wiki Link Macro
Allows to render a link to a wiki page.
Display Table Macro
Lists references to projectdoc documents in a table. Allows to select document properties for columns. Also non-list representations are provided.
Content Marker Macro
Marks a piece of content within a document. This content can be referenced for transclusion.
Remote Control
Supports Remote Controlled Documents by making parameters accessible via request parameters.