Forums

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

Adding a hyperlink in title of Panel Macro

Stephen Williams
Contributor
September 19, 2013

I'd like to add a hyperlink to the Panel Title portion of the Panel macro, so that users can click the panel's title and link off to another page.

I have tried using the following with no luck (as an example):

{html}<A href="http://www.atlassian.com">9999</A>{html}

<A href="http://www.atlassian.com">9999</A>


Does anyone know if this is possible using the Panel macro?



Thanks!

Stephen

2 answers

1 accepted

4 votes
Answer accepted
Stephen Williams
Contributor
September 23, 2013

Thanks Davin! I actually got it working by simply placing the page's title within [] brackets, similar to how it was done in Wiki Markup pre 4.0. Doing this automatically creates a hyperlink.

Davin Studer
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.
October 2, 2013

Sweet! Good to know. Much easier.

Nguyen Duong Tung
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!
August 23, 2018

Can you show me where to put the link http://www.atlassian.com? Can you format the title font color?

Jonas Jurczok
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!
September 27, 2018

To update the answer..

In the current version of hosted confluence the described solution does not work anymore.

You can use normal markdown in the title though.

This means [display text | url ] (without the extra spaces) will be rendered as link.

Like Elle Allen likes this
Susan Ostreicher
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.
October 11, 2018

@Jonas Jurczok Thanks for this! I'm using Server, but it seems like the brackets don't work when there is a special character in the page title, and your suggestion solves that problem. 

Like Elle Allen likes this
0 votes
Davin Studer
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.
September 23, 2013

You could do this inside an HTML macro.

&lt;script type="text/javascript"&gt;
var url = 'http://www.google.com'; //&lt;-- the url to visit
var panel = AJS.$('.panel .panelHeader')[0]; //&lt;--- [0] is the first panel, [1] is the second, and so on
AJS.$(panel).html('&lt;b&gt;&lt;a href="' + url + '"&gt;' + AJS.$(panel).text() + '&lt;/a&gt;&lt;/b&gt;');
&lt;/script&gt;

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events