Help with Run / Hide Macros

Jonathan Gold February 3, 2014

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

1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2014

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}

Jonathan Gold February 9, 2014

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!

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2014

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

Jonathan Gold February 4, 2014

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
TAGS
AUG Leaders

Atlassian Community Events