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

How do you nest Blueprint placeholders inside a macro with a plain text body?

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 23, 2013

I've got a Confluence Blueprint where the template.xml contains a macro with BodyType.PLAIN_TEXT and is similar to:

<ac:macro ac:name="awesome-macro"><ac:plain-text-body><![CDATA[

<ac:placeholder>My placeholder text</ac:placeholder>

]]></ac:plain-text-body></ac:macro>

The <ac:placeholder/> node is of course escaped, so appears in plain text on any page created from my Blueprint.

How is it possible to get the placeholder to work correctly?

My best guess is that it's not possible at this moment as Blueprints are fairly new, but please enlighten me :)

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
kat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 5, 2013

Hi David,

Sorry I never replied properly! Yep, unfortunately it looks like you just can't do it - I was trying to do this the other day and plain-text-body blocks just swallow anything except plain text. I've raised CONF-30673 for you.

Cheers,

Anna

0 votes
kat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2013

Hey David,

This should work okay. I think the problem is the CDATA tag. Try putting the placeholder directly in the plain-text-body tag and it should show up unescaped.

Cheers,
Anna

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 23, 2013

@Anna Katrina Dominguez: Thanks for the reply. I tried that. Without the CDATA section, the content of the macro appears empty :(

kat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2013

Hi David, I just tried this on my local instance and it worked fine:

&lt;ac:macro ac:name="panel"&gt;
    &lt;ac:rich-text-body&gt;
        &lt;ac:placeholder&gt;My placeholder text&lt;/ac:placeholder&gt;
    &lt;/ac:rich-text-body&gt;
&lt;/ac:macro&gt;

Which version of Confluence are you using?

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 23, 2013

@Anna Katrina Dominguez:

Right, I'm using <ac:plain-text-body> and you're using <ac:rich-text-body> -- I think that's the problem.

I'm on Confluence 5.1.4.

TAGS
AUG Leaders

Atlassian Community Events