Forums

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

How can I use macros in list variable in a blueprint?

Stuart
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2013

I'm trying to create a project plan blueprint. I'd like a list variable that contains a list of Status macros. For the list I enter:

{Status:colour=red},{Status:colour=grey}

But all I get is the text when I use the blueprint. Is there a way to make Confluence recognize the wiki markup when it processes the variable or is there another way to do this?

Thanks!

4 answers

0 votes
shess
Contributor
September 1, 2013

In blueprints you can integrate macros in that way:

<ac:macro ac:name="status"><ac:parameter ac:name="color">red</ac:parameter></ac:macro>

Cheers

0 votes
Hardy Gieldanowski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 1, 2013

You can do this by setting the ac:name="colour" parameter. In your template.xml:

<ac:macro ac:name="status"><ac:parameter ac:name="colour"><at:var at:name="status"/></ac:parameter>
</ac:macro>

in your template.soy:

<fieldset>

<div class="field-group">

<label for="status">{getText('my.blueprint.form.label.status')}</label>

<select id="status" class="select" name="status">

<option value="grey">{getText('my.blueprint.option1')}</option>

<option value="yellow">{getText('my.blueprint.option2')}</option>

<option value="green">{getText('my.blueprint.option3')}</option>

<option value="blue">{getText('my.blueprint.option4')}</option>

<option value="red">{getText('my.blueprint.option5')}</option>

</select>

</div>

</fieldset>

I didn't figured out how to dynamically set a custom text for the options. I guess you would have to do that in the template.js. Any ideas?

0 votes
Mauro Molinari
Contributor
July 21, 2013

I'd also like to know if there's a way to achieve this (i.e.: a variable which can be set to one of n possible status macros/values). But I think it's not possible :-(

Ideas welcome.

0 votes
hsuhailah
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.
June 30, 2013

You'll need to enter the above macro inside a Wiki Markup (from the Editor > Insert > Wiki Markup)

Stuart
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2013

Thanks for the reply, Hanis. But I don't follow what you mean. I understand how to add Wiki Markup, but what I'm trying to do is get wiki markup inside a list variable. So, that when you go to create a page from the template, you can select the appropriate status macro from the drop down list and have it create the macro on the page rather than just the plain text like it has been doing.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events