I would like to include the full URL to a page in the page itself. The reason for this is that we export page to word and forward this exported word document to downstream systems.
I would like to include the link to the page in confluence to be able to close the loop. If any fault or comment is needed it would be easy for the once using the word-doc to select the link and get directly to the source information and change/comment on the page in question. This is why I need the full long URL to the page.
The person writing the page in Confluence could of course type in the URL manually but users often forget/type the wrong URL or forget to update if they change the page title so I want an automatic way to do this.
I wrote a small JavaScript to get the page URL and insert it which works well in Confluence but the information is not included in the exported version for some reason. (not in word nor in pdf).
My question is if there exist either a Confluence native way to do this or how I would get the exported document to include the result of the URL.
The JavaScript I use (inside a HTML Marco) is:
I have the Cloud version, but there I can:
Would this not meet your needs? Maybe I am misunderstanding what you are trying to achieve. I would hope this type of link is updated when the name of the page is changed, but I have not tested this.
Thank, I use a server based instance and a similar function exists and works to insert a link but when inserting it as a full URL is will not get updated.
Creating a link where the page name is used the link and ref is update if the page name change but with the same problems as with my solution. When exporting to word (and pdf) the URL is no exported correctly. This is apparently a known problem, see Links to Confluence when exporting to PDF/Word (atlassian.com).
It seems I need to either need to use the manual approach and hope people can follow instructions or I make a script that enhances the export and inserts the page url when the page is exported.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @J W ,
you can do that with a user macro. The following code will print the URL of the page on the page itself, if you put your usermacro on the page:
$settingsManager.getGlobalSettings().getBaseUrl()$content.getUrlPath()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, unfortunately I do not have sys admin right on our installation. We have a large server based installation with many spaces and the sys admins are centralized. I will try to convince them to let me test this on our dev version.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.