Button / link to parent page / one level up?
Asked by Tom?? Vrabec:

Hi guys,

I searched some articles in here, but no exact answer.

Is there a out of box way, how to implement "level up" / "go to parent" page button / link into the Confluence Server / DC without any external plugin?

Customer is 15k users, there is almost no possibility to purchase any plugin in schedule less then 2-3 years of planning :)

Thanks for hints.

T.


Answers:
author: Nicolai Sibler
body: Like [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089) said, you'll need an user macro for that.

Here is it (h/t [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483)):

    ## @noparams
    #if (!$content.getParent()) <b>No parent page found</b> 
    #else
    #contentLink2($content.getParent() false false) 
    #end

To use it globally or space-wide you could place the macro in the footer (Look and Feel ? Sidebar, header and footer).

comments: author: Tom?? Vrabec
body: Thanks for the hint, will follow up with admins! :-)


author: frithjof falck
body: Is it possible to add the url of the parent page in i a link \<a\>?


author: Nicolai Sibler
body: [@frithjof falck](/t5/user/viewprofilepage/user-id/4596230) Please elaborate on what you actually want to achieve. Your requirement seems to be different from the one above.


author: frithjof falck
body: This user macro shows the page name of the parent page as a clickable link. Would it be possible to make a user macro that has an \<a\> tag so that i can change the name of the link to for example "x"?

\<a url="link to parent page"\>LINK NAME\</a\>


author: Nicolai Sibler
body: I'm not sure if this is possible as I'm not a coder.


author: Andrew Pascarella
body: Why is such simple thing not available as a built in macro? Yes I understand you can just insert a link. However we are trying to automate page building with templates and this is one less thing to add.   

I've tried the code above and it's not working.


author: Tom?? Vrabec
body: [@Andrew Pascarella](/t5/user/viewprofilepage/user-id/5055842) code is fully working, using every day, in many templates and pages.


author: Andrew Pascarella
body: Not sure, I'm not a coder or programmer. Trying to fix a broken macro from another user that got placed in 400+ pages.   

I copy pasted this code to replace the original link to parent code and it doesn't work for me. We are on Data Server 7.19.   

From what I'm reading that code should work, so I'm not really understanding why it won't.


author: Stefanos
body: Hi,

I'm using such a user macro.

Since the last update (to 7.19.16) it shows this linktext

$htmlUtil.htmlEncode($content.displayTitle)

instead of the parent page's title.

The link itself works.

Any tips?

Best regards


author: Kevin Bishop
body: I have the same error too.


author: Nicolai Sibler
body: [@Stefanos](/t5/user/viewprofilepage/user-id/1027995) [@Kevin Bishop](/t5/user/viewprofilepage/user-id/5414710) Please check [CONFSERVER-82741](https://jira.atlassian.com/browse/CONFSERVER-82741)


author: Bill Bailey
body: My suggestion is to write a user macro to do what you want. You will need cooperation from your admins to install the macro. AND you will have to install the macro each time you want to use it.

You may also be able to do it for every page using javascript, but I will assume that your admin team would view that as needing 2 to 3 years of planning.


author: Chris Iacovelli
body: The "Link to Location" macro will also work here.

comments: author: Chris Iacovelli
body: --- deleted a bad HTML code that would not do what you wanted


Tags: button

confluence-server

hierarchy

link

page

page-tree

server