Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Macro inside macro?

Elliott Ing August 25, 2011

I'm using Confluence with the Scaffolding plugin. I've got a frield called `postcode`, and I can get the value from it using report-info. However, when I try to embed this value inside another macro (in this case, the google maps one, to have an automatic map of the location), it fails. {report-info} returns the value correctly, but the outer macro is printed (so I see the {googlemaps-etc} text on the page), rather than being rendeder.

Can anyone suggest how to do this?

1 answer

1 accepted

1 vote
Answer accepted
David Peterson
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.
August 25, 2011

Hi there,

I'm assuming you're trying something like this:

{my-macro:someParam={report-info:data:My Field}}

As you noted, that won't work - it's simply not how Confluence parses macros. There is a workaround however. You can 'inject' values into other macros by using the {report-on:injected=true} macro that comes with the Reporting Plugin. You can also use the {replace-and-render} macro from Adaptavist, but I'll leave that example for others.

To to use {report-on} in this situation, it would be something like this:

*My Parameter Value:* {text-data:My Parameter Value}
{report-on:injected=true}{some-other-macro:theParameter=%data:My Parameter Value%}{report-on}

The '%...%' markup is pasted in before the {some-other-macro} is executed, which should achieve what you're after. Check out the documentation for more details:

http://wiki.customware.net/repository/display/AtlassianPlugins/report-on

http://wiki.customware.net/repository/display/AtlassianPlugins/Suppliers

Hope that helps!

Regards,

David Peterson

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events