Link Page Name By Macro

Problem: I want to create a dynamic link to the current page based on the title of the current page.

I had our confluence admin create the macro which I found at:

This seems to work once, however, when the link is rendered it shows up with at + but then does link to the page properly when clicked.

The problem is when the page is edited, the text [{pagename}] has been replaced with:

&linkCreation=true&fromPageId=38176348" class="createlink"linktype="raw" wikidestination="{pagename}
" originalalias="{pagename}
" >{pagename}

Anyone have an idea?

1 answer

You could use report-info... something like:


Let's say you wanted to use the title of the parent page as a prefix, you could do something like:

[{report-info:page:parent > page:title} Your Wiki Suffix]

I recently coded up a navigation bar that allowed somone to "click" to create sub sections within a project area using the reporting macro in conjunction with the add-page macro to attempt to push naming consistancy within a project. For each subsection within a project, I had the following code (edited for the specific section):

{report-list}{local-reporter:page:parent > content:children} {content-filter:@self|labels=+fy12_actions} {local-reporter}{report-body}{report-link}Action Items{report-link}{report-body}{report-empty}{add-page:allowRename=true|template=FY12 Project Actions|live=true|name=%content:title% Action Items|parent=@parent}Action Items{add-page}\\{report-empty}{report-list}

Hopefully that gives you some ideas...


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,090 views 56 8
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