Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Macro to list page's labels - Confluence Cloud

William Wynn November 9, 2018

Is there any way on Confluence Cloud to display a list of the page's labels somewhere on the page?

I know the default template shows labels at the bottom of the page, but I would like to be able to place them where they are needed.

Additionally I've seen some suggestions of using a User Macro, but these are not available in Confluence Cloud.

Ideally the Labels List Macro would let you specify a specific page: https://confluence.atlassian.com/doc/labels-list-macro-180846844.html

1 answer

1 accepted

1 vote
Answer accepted
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.
November 9, 2018

Well, this isn't ideal. And by that I mean jamming a fork in your arm might be more enjoyable. But, I found a way. : )

First put a style macro somewhere on your page and put this in it.

.content-by-label .details a[data-linked-resource-type=page], .content-by-label .icon.aui-icon {display: none;}
.content-by-label .details {padding-left: 0 !important;}

Then you can put Content by Label macros anywhere on your page that you want the label list to appear. Set up the Content by Label macros to look like this ...

For Label put in a label you know is on the page. Then a a title and space filter. For With title put in the page name. For In space put in the space your page is in.

Capture1.PNG

 

Make sure Excerpt Display is set to none.

Capture2.PNG

 

In Edit mode your page will look like this.

Capture3.PNG

 

In View mode this is what you will see.

Capture4.PNG

William Wynn November 27, 2018

Thanks, it works at least! Here are a few notes for anyone else that needs to do this that I found out:

  1. Similarly Named Pages - I had pages with names that contained this pages name. Two things helped here:
    1. Put the "With title" page name in quotes.
    2. Use "-" to exclude word from matching. For example to Match "Order Download" and not "Purchase Order Download" I entered:
      • "Order Download" -"Purchase"
  2. Uncheck the "Show Space Name for Each Page" Option

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events