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 Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,147 views 20 14
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