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 answer
Community showcase
Published Nov 29, 2018 in New to Confluence

How to use Confluence Cloud for stakeholder management

Most of us don’t need much convincing that stakeholder management is important. It just makes sense that keeping everyone in-the-know on projects and assigning clearly defined roles is key to having ...

1,168 views 4 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you