Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to force all links to be a page ID rather than the pretty format?

Zach Zampetti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2019

Pretty names are fairly useless for external links since changing the name of a page breaks the link. Is there a way to force all pages to use ID so it is easier to copy and paste links? 

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2019

No, there's no way to do this easily.  You'd have to turn off the code that makes the "pretty" urls.

I tend to use the short links (in the page properties) which are also invariant.

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2019

Well won't the pretty URLs redirect (or at least point the user to the correct page)?

And yeah, tiny URLs is probably the easiest way to go.

Zach Zampetti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2019

Thanks. The short links seem to work. I just wish there was an easier way of getting those links. Having to open each page and then wait while the link is generated is a bit slow. 

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2019

Maybe update the page layout to display that value? Then it would always be visible,

Docs are here customizing-site-and-space-layouts.

You will have to search on how to get the tinyURL.

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2019

Actually, this decorator file will give you some clues

link-to-this-page.vm

#* @vtlvariable name="globalSettings" type="com.atlassian.confluence.setup.settings.Settings" *#
#* @vtlvariable name="page" type="com.atlassian.confluence.pages.AbstractPage" *#
#if ($page && $action.tinyUrl)
<content tag="canonical">
##We want search engines to index the current version of the page, not the historical ones.
#if ($helper.isHistoricalVersion())
<link rel="canonical" href="$globalSettings.baseUrl$generalUtil.htmlEncode($generalUtil.getPageUrl($page.originalVersion))">
#else
<link rel="canonical" href="$globalSettings.baseUrl$generalUtil.htmlEncode($generalUtil.getPageUrl($page))">
#end
<link rel="shortlink" href="${globalSettings.baseUrl}/x/$action.tinyUrl">
<meta name="wikilink" content="$generalUtil.htmlEncode($page.linkWikiMarkup)">
<meta name="page-version" content="$page.version">
<meta name="ajs-page-version" content="$page.version">
</content>
#end
Like Zach Zampetti likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events