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:

http://confluence.atlassian.com/display/DISC/Show+Page+Name+as+Link

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:

[{pagename}
&linkCreation=true&fromPageId=38176348" class="createlink"linktype="raw" wikidestination="{pagename}
" originalalias="{pagename}
" >{pagename}
|/pages/createpage.action?spaceKey=ClientEngineering&title=%3Cdiv%20class=]

Anyone have an idea?

1 answer

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

[{report-info:page:title}]

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...

Dave

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,990 views 25 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