Confluence 4.0: How can I use the title of a page inside a macro called within a user macro?

How can I use the title of a page inside a macro called within a user macro in confluence 4?

I.e. the following inside a user macro doesn't work:

<ac:macro ac:name="info">$content.getTitle()</ac:macro>

It returns an empty info box.

1 answer

1 accepted

Hi Daniel,

Try:

<ac:macro ac:name="info">
  <ac:parameter ac:name="title">Foo</ac:parameter>
  <ac:rich-text-body>$content.getTitle()</ac:rich-text-body>
</ac:macro>

I.e. put $content.getTitle() inside a <ac:rich-text-body> element. Just did a quick test on my 4.x install and it seems to work.

Andrew.

This won't get the full title if the title contains characters between < and > symbols for instance the title

I am <not> tall

with be displayed

I am tall

Do you know if there is a fix for this?

Using 4.1

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,231 views 23 10
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