Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax for a variable inside a style attribute in a user macro

John Corwith
Contributor
June 20, 2017

Looking to write a macro where the user can configure the table border color. Need something along the lines of:

<table style="border: 2px solid $colorvariable;">

but I need to 'escape' the $colorvariable.

my macro works as expected with

<table style="border: 2px solid white;">

1 answer

0 votes
Thomas Schlegel
Community Champion
June 21, 2017

Hi John,

this should do it:

Macro Body: rendered

## @param colorvariable:title=Colorvariable|type=string|required=true
<table style="border: 2px solid $paramcolorvariable;">
John Corwith
Contributor
June 21, 2017

oops, I forgot the param leading the attibute. will try that, thanks!

Thomas Schlegel
Community Champion
June 21, 2017

did you name the variable "$paramcolorvariable"?

without "param" before the variable name, it doesn't work. In your example code, you name the variable just $colorvariable.

John Corwith
Contributor
June 21, 2017

did the following:

## @param colorvariable...

<table style="border: 2.0px solid $colorvariable;">

my bad. will test in a few but I'm pretty sure you hit it. have programmed in too many different languages. thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events