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
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,187 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