Add a link to the status macro

Is it possible to add a link to the Status macro in Confluence?

2 answers

No, but using User Macros you could write your own and adding in the functionality.

You can find the VTL code for a version (I'm not sure how modern it is) for the code here:

  1. You can write it and then add a parameter for a link.
  2. When the user enters something in that field you could have it generate an <a> tag around the lozenge that points to the URL mentioned.

We wanted to do this and came up with a jQuery based solution. It works well for us, as the coding is hidden from users in a page template. The gist of it is to define the link you want to apply in the normal way, but inside a "div" element (thanks to the Adaptavist Content Formatting macros plugin). This div has its style property set to display:none, so is invisible when the page is viewed normally. The jQuery code looks for this link and applies it to a status macro, based on the text that has been set for it.

Why go to the trouble of making a hidden link in this way? Since it relies on the normal Confluence functionality to do this, I see benefits if the target page was to undergo a change of name. In other words, we're not hard-coding the link.

Here's some sample code. If you have the plugin I mentioned and the html macro enabled in your environment, then just put this directly into a test page and you should see it works nicely. Note - the link is put on the entire status box, not just the text within it.

{status:colour=Green|title=Wiki User Guide}

{div:userguidelink|style=display: none;}
&lt;Your link here&gt;

&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function() {

    // Add links to status boxes
    jQuery('#statusboxes span:contains(Wiki User Guide)').hover(function(event) {    
      jQuery(this).css( 'cursor', 'pointer' );
    jQuery('#statusboxes span:contains(Wiki User Guide)').click(function(event) {
      window.location = jQuery('#userguidelink a:first').attr('href');
      return false;


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,416 views 3 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you