How can i use the labels of a page automatically in the content by labels macro

Stefan Meier September 10, 2020

I am creating a new template with a see also section in the bottom. I would like to include the content-by-label macro and adjust it in a way so that it always shows all sites that have the same labels. Is that possible? Or how can I do that (other than manually)?

2 answers

0 votes
Anil Prasad October 29, 2020

I want this, too. I'm also in cloud. Seems like a setting that should be allowed inside the macro.

0 votes
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.
September 10, 2020

If you enter the macro in the template with a set of labels, then when you use the template, the macro will always display the content matching those labels. I guess I am not seeing what the issue is?

Stefan Meier September 10, 2020

No, it’s a template, so when a user uses it and ads labels to the page, the macro should automatically show the content with these labels. I want automation! 

Like Marya Belanger likes this
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.
September 10, 2020

OK, then there is this solution using a user macro:

https://confluence.atlassian.com/display/DISC/Related+Content 

Now personally, I would probably make this simpler as a wrapper user macro that reads the label(s) from the page, then feeds them to an instance of Content by Label macro. A cleaner solution.

I wrote an article about this process: Getting-Started-with-User-Macros-Writing-a-Wrapper-Macro 

Stefan Meier September 21, 2020

Hey Bill,

thx for the answer. You might have overlooked, that I am in Confluence Cloud and I cannot use user macros. Is there also a solution for cloud?

Stefan

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.
September 21, 2020

Yes, switch to the server version? (bad joke) There are two main reasons I advise clients to not use the Cloud version of Confluence:

  • No control over what version you are running (workflows can break without notice)
  • Lack of user macros.

I have not tried this route, but:

  • Develop your user macro on a local server version
  • Package your macro as a plugin
  • Install in the Cloud

The first two I have done, but I am not sure if the Cloud version will allow installing a plugin derived from a user macro.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events