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 edited

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
atlassian, knowledge sharing, intentional knowledge sharing playbook, loom, confluence, team collaboration, knowledge management, workplace productivity, information silos, documentation best practices, internal communication, knowledge sharing strategies

Conquer collaboration chaos with Loom + Confluence

You don't need more tools. You need tools that actually work together – the way humans do. See how Loom + Confluence help teams collaborate with more context, more connection, and fewer calendar invites. 💪

See inside
AUG Leaders

Atlassian Community Events