Can we link to a confluence page using the path of that page rather than what appears in the address
Asked by david Chevreau:

Hello,

as the subject says, can we link to a confluence page using the path of that page (ie space/page/page/page) rather than what appears in the address bar?

Thanks.


Answers:
author: david Chevreau
body: In fact, i want a full path link to use from an external app with variables to define the link. Because as it is, i should perform the creation of a space for each environnement we use instead of creating subpages as we want to do. (Perhaps it's a solution...)

But if you have another solution with tags or anchors, i take it.

comments: author: Nic Brough -Adaptavist-
body: Ok, well that's nonsense, the url is what you want in the external link, not space and page names.

You could code your application to understand and replicate Confluence page urls given the space and page name though - the urls are created from base url + page-area + space key + page name (assuming you're using a page title that does not have unusual characters in it). If you code for that, your application will be able to work out the link.


author: david Chevreau
body: that's what i'm doing now. thanks


author: Nic Brough -Adaptavist-
body: Ok, great.

I didn't mention the breadcrumbs before - they're not actually there, there is no structure for them in Confluence **pages**, each space just contains a pile of uniquely named pages. Hence, they are not part of the url for a page either. The page tree is built separately in a pile of functions that effectively builds an index and then shows it to us in various ways in the UI.

That actually makes your code a bit more simple - you don't need to worry about the tree/breadcrumbs/container stuff. It's just "page X in space Y in Confluence Z"


author: Alex Koxaras _Relational_
body: Hi [@david Chevreau](/t5/user/viewprofilepage/user-id/4441166)

I'm a bit confused. You want to link a page within confluence using "breadcrumbs", or you want a full link path? And what is it about the space creation?

What exactly you want to achieve?

comments: author: david Chevreau
body: i'd love to make an url with the tree structure to adress confluence page from another app which uses this same structure.

But it is simpler like it exists in case of space change. I will do with space name and page name.

Thanks for your concern.


author: david Chevreau
body: PS: i'm a relatively newbie in using confluence and a simple user, not admin (it limits possibilities). So i'm not very used to confluence "thinking".


author: mykhailo m
body: [@david Chevreau](/t5/user/viewprofilepage/user-id/4441166)

I created request for feature (for Cloud Confluence), but as I understand, unfortunately, we will wait for it for ages...

[https://jira.atlassian.com/browse/CONFCLOUD-72601](https://jira.atlassian.com/browse/CONFCLOUD-72601 "Extend \"Insert link\" functionality with [Display as path] (breadcrumb)")

If that is what you have expected, then you may vote for this feature...

If you need it for Stand alone version, you may have a look on macro, but I think it has to be modified... to provided breadcrumbs link for linked page.

<https://community.atlassian.com/t5/Confluence-questions/How-can-I-create-a-Confluence-user-macro-that-displays-the-full/qaq-p/937886>

```
## @noparams#set($breadcrumbs = "")#set($breadcrumbSeperator = " / ")#getBreadcrumbs($content.id)$breadcrumbs##recursive macro to get the path to page breadcrumbs#macro( getBreadcrumbs $contentID )    #set($thePage = $pageManager.getPage($contentID))        #set($breadcrumbs = $thePage.getTitle() + $breadcrumbs)        ## Does this iteration have a parent?    #if($thePage.getParent())        #set($breadcrumbs = $breadcrumbSeperator + $breadcrumbs)                ## Get parent of this iteration        #getBreadcrumbs($thePage.getParent().getContentId().asLong())    #end#end
```

Best wishes,

Mykhailo

comments: author: david Chevreau
body: Thank you.

I voted !

I looked in macros, but it seems too time consuming for me to learn it and install the sdk.

Another thanks for this macro.


author: Nic Brough -Adaptavist-
body: Yes, when you're writing, use the link function (shortcut is a square bracket on server) - it'll ask you for a space and a page name. (The space is optional, it assumes "the current space" if you don't specify one)

comments: author: david Chevreau
body: thanks. I add details below to my question.


Tags: questions-for-confluence

server