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 Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

904 views 2 13
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