Help with Run / Hide Macros

I am trying to write a report in Confluence that displays content based on a select list. My thought was to use the Run macro for the select list and then the showIf parameter of the Hide macro to display the data. I'm not having much luck with the Hide macro however. I've placed the select list variable outside of the macro to make sure Run is producing the proper value which it is. I've even tried regexp to match just the last character but still not working

{run:id=1|replace=MyProject:aaa::select::aaa:a:bbb:b}
$MyProject
{hide:showIf=.*a:$MyProject}
Show this if option a is selected
{hide}
{run}

2 answers

Your example works fine for me

{run:id=1|replace=MyProject:aaa::select::aaa:a:bbb}
My project: $MyProject
{hide:showIf=aaa:$MyProject}
Show this if option a is selected
{hide}
{run}

Hmm. This is what I was trying initially and does not seem to work. I am using an older version of Confluence however. I"ll try upgrading everything. Thank you for your response!

Add literal=false as a parameter on the hide macro. Default was literal to aid the novice user and mess up the advanced user :(.

Hi Bob. Thank you for the reply. If I can use literal that's fine, I was only trying with a regexp because the literal would not work. What I need to have happen is when the variable MyProject='aaa' the content is shown. Unfortunately the documentation for the macro does not provide an example of this parameter in use. I have tried the literal {hide:showIf=aaa:$MyProject} .... {hide} but that does not work. Could you please provide an example of using the showIf?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

292 views 11 10
Join discussion

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