Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to display content on condition?

I have code like this:

{local-reporter:content:descendents|source=PUB:Surce Page}


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

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!

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

Suggest an answer

Log in or Sign up to
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

364 views 4 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you