Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confluence blueprint substitution does not work in macros with plain-text body

I've created a Confluence blueprint plugin as per the basic/intermediate/advanced tutorials available from Atlassian. I now want to update the page template to include a {HTML} macro with embedded CDATA, where a URL in that CDATA contains a portion to be substituted with user-entered data.

What I'd ideally like to do, with the <at:var...> being substituted with locationid:

<ac:structured-macro ac:name="html">
  <ac:plain-text-body>
    <![CDATA[<iframe src="http://...?locationid=<at:var at:name="locationid"/>"></iframe>]]>
  </ac:plain-text-body>
</ac:structured-macro>

Unfortunately this does not work; the <at:var at:name="..."> inside CDATA can't be substituted.

I've tried various formats of this, for example substituting in the entire CDATA string itself, even going as far as substituting in the entire <ac:structured-macro> block in a single string. None work.

A Google search brought up two very similar questions on the Atlassian community wiki, this and this. Furthermore I found a Confluence Server JIRA to fix this problem, but it's been rejected and closed.

Despite the evidence against a solution I'm hoping that someone creative has an idea of how I can achieve this?

Atlassian SDK: 6.2.14

like image 282
MeterLongCat Avatar asked Aug 07 '17 07:08

MeterLongCat


People also ask

Can you create a macro in Confluence?

To create a user macro: Go to the Confluence Administration Console. Select 'User Macros'. Enter the macro metadata and input data as prompted.

Are Confluence macros free?

Of course! We offer a Free plan for Confluence for up to 10 users, 2GB of storage, and Community Support.


1 Answers

I'm not exactly sure what you're asking ;) but could it be the same as this discussion in our doc space?

Confluence 4.3-RC1 Release Notes

like image 123
Kondal Avatar answered Sep 16 '22 15:09

Kondal