How to display content on condition?

Michal Zebrowski July 21, 2011

I have code like this:

{report-block} 
{local-reporter:content:descendents|source=PUB:Surce Page}
{text-sort:content:title}
{local-reporter}

{report-body}
h3.{report-info:content:title|link=true}
{report-info:content:excerpt|render=wiki}
----
{report-body}
{report-block}

Now, I want give User posibility to choose if he wants to see page's title and the content, or only a title. So, I need two things:

1. some macro which let user to choose 'view mode' (some kind of checkbox)

2. some macro which has option to show/hide the content on condition

I tried to work with {checklist} macro and {builder-show} (does it work with default theme?), but I failed. I don't know how to connect them.

2 answers

1 vote
JohnA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 12, 2011

Not quite perfect, but take a look at the run macro, which lets you pass parameters to a page and then modify page content based on those parameters. Great for changing parameters to an SQL macro, but can also change content of the page itself. You could possible rig it to activate a nodisplay macro to hide content.

Actually, even better would be to use it to pass a parameter to Adaptatvist's cloak macro which can show/hide content.

If you're really adventurous, you could include content to toggle CSS styles to show/hide information, much like the Confluence Documentation Theme shows/hides a side panel. Mark secitons with a style macro and then create a trigger mechanism.

Let us know how you go!

0 votes
Michal Zebrowski August 17, 2011

The solution with CSS styles sounds promising. Could You give me some hints?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events