Macro inside macro?

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
Accepted answer

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
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

60 views 3 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you