Button / link to parent page / one level up?

Tomáš Vrabec
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.
August 4, 2021

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.

3 answers

1 accepted

2 votes
Answer accepted
Nicolai Sibler
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.
August 5, 2021

Like @Bill Bailey said, you'll need an user macro for that.

Here is it (h/t @Thomas Schlegel):

## @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).

Tomáš Vrabec
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.
August 5, 2021

Thanks for the hint, will follow up with admins! :-) 

Like Nicolai Sibler likes this
frithjof falck February 2, 2022

Is it possible to add the url of the parent page in i a link <a>?

Nicolai Sibler
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.
February 3, 2022

@frithjof falck Please elaborate on what you actually want to achieve. Your requirement seems to be different from the one above.

frithjof falck February 3, 2022

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>

Nicolai Sibler
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.
February 4, 2022

I'm not sure if this is possible as I'm not a coder.

Andrew Pascarella April 29, 2023

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. 

Tomáš Vrabec
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.
April 29, 2023

@Andrew Pascarella code is fully working, using every day, in many templates and pages. 

Andrew Pascarella May 1, 2023

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. 

Stefanos January 12, 2024

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

Kevin Bishop
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!
February 16, 2024

I have the same error too.

 

Nicolai Sibler
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.
February 19, 2024
1 vote
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.
August 4, 2021

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.

0 votes
Chris Iacovelli January 9, 2023

The "Link to Location" macro will also work here.

Chris Iacovelli May 5, 2023

--- deleted a bad HTML code that would not do what you wanted

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events