I would like the label list to be the current labels of the page. How can I do that in confluence ?
Asked by Benoit des Ligneris:

*This question is in reference to Atlassian Documentation: [Content by Label Macro](https://confluence.atlassian.com/pages/viewpage.action?pageId=145566)*

I want to display a link toward all pages with the same labels as the current page.

This is for a knowledge base : I want all similar FAQ questions to be displayed at the bottom of each of my FAQ articles.

* The "Content by Label" dot now allows this
* The "Related labels" is somehow displaying the current label list with a link to search and not to the article titles the article (could be useful if the number of links where displayed !)


Answers:
author: Robert Reiner _smartics_
body: Deleted. Please see reply above.


author: Robert Reiner _smartics_
body: The [projectdoc Toolbox](https://www.smartics.eu/confluence/x/EAFk) allows to create queries on documents based on the document that contains the query. Unfortunately this add-on is **only available on premise**.

Suppose you need to select on the Tags property, the query (using the [Display Table Macro](https://www.smartics.eu/confluence/x/wgNk)) will look like this:

```
   Tags=${Tags}
```

That is: find all documents with the Tags property (left hand side) matching the tags provided in this document (referenced by `${Tags}`). Note that the list of tags is 'anded', therefore all tags need to be specified on a document to make it part of the result list.

There is a tip with an example on our web page: [List related Pages](https://www.smartics.eu/confluence/x/-4uLAg).

Biased alert: I'm one of the authors of this commercial add-on. :smile:

comments: author: Benoit des Ligneris
body: Yes. This would be quite similar to that :wink:  

Any chances this will work on the cloud edition ?


author: Robert Reiner _smartics_
body: Unfortunately no. ![sad](/html/@C495B4504065515364EB1894F812B34C/images/emoticons/sad.png "sad")

The toolbox add-on is bound to the Java API and therefore requires to be installed on the on-premise version of Confluence. There are no plans to provide a cloud version of the projectdoc Toolbox in the near future.


author: Malcolm Cook
body: Hi [@Benoit des Lign](/t5/user/viewprofilepage/user-id/270362) - If I understand correctly, this could NOT be used in conjunction with the "Content By Label" macro. This special syntax,

```
Tags=${Tags}?
```

will only work in macros included with your product. Is that correct? Thanks.


author: Robert Reiner _smartics_
body: Yes, this is correct: It works only with the projectdoc Toolbox.


author: Javier T?vara
body: [@Robert Reiner _smartics_](/t5/user/viewprofilepage/user-id/853340) I've just installed you addon, looks great. What if I want to show posts with SOME of the ${Tags} ?


author: Robert Reiner _smartics_
body: Deleted. Please see reply below. :)


author: Robert Reiner _smartics_
body: [@Javier T?vara](/t5/user/viewprofilepage/user-id/726668): Sorry, it seems that may last reply did not get published (probably to something I messed up).

I assume you are using a macro like the [Display Table Macro](https://www.smartics.eu/confluence/x/wgNk). You can select on any literals you want. For instance

```

$<Tags>=[One] OR $<Tags>=[Two]

```

If you have a list of values you can also use

```

$<Tags>~(One, Two)

```

Besides the OR you can also use AND or NOT (but NOT only as connector for the second value as in

```
$<Tags>=[One] NOT $<Tags>=[Two]
```

The list operator assumes the values of the list to be or-ed.

More information on creating queries for the [macros](https://www.smartics.eu/confluence/x/GQFk) of the [projectdoc Toolbox](https://www.smartics.eu/confluence/x/1YEp) can be found in [Search Tips](https://www.smartics.eu/confluence/x/dAVk).

A second approach would be to define the set of query values as a new property of the document by the use of the [Document Properties Marker Macro](https://www.smartics.eu/confluence/x/rgNk). E.g. "My Search Params"="One, Two" (The first is the key, the second is the value, [controls](https://www.smartics.eu/confluence/x/W4ej) (third column) could be set to "[hide](https://www.smartics.eu/confluence/x/XYej)" if they should not render.  

Then you would use

```

$<Tags>~(${My Search Params})
```

You could use the [Display Document Property Macro](https://www.smartics.eu/confluence/x/sANk) (or one of its relatives) to add these property values to the [Tags property](https://www.smartics.eu/confluence/x/SYqj) (this is a bit clumsy currently since you need to add the value separator manually and therefore need to know if there are already a values).  


author: spud
body: Hi @Benoit des Ligneris - thanks for your question.

So, as far as I can understand, what you're asking for is a way to automate the content by label macro to populate the 'labels' field with the same labels as on the page it's on - is that right?

There's no way to do this at the moment. The content by label macro will create a list of all the articles tagged with the labels you put into the macro, but you can't set the macro to automatically to pull the same labels as the page. You have to put those labels in manually.

Let me know if I've misunderstood your question!

comments: author: Benoit des Ligneris
body: Yes. That's it !

I wonder why this is not possible : indeed, I can imagine most of the knowledge based (FAQ, etc.) should greatly benefit from this key functionality.

Is this a function planned for development ?  
How can I suggest this function ?  

Also, are you aware of any plugin that can do that on the cloud ?


author: spud
body: I had a look but I don't think there any plugins that do that.

I totally agree that it's a nice idea - being able to display related pages.

What you could do is create a [feature request](https://confluence.atlassian.com/confeval/billing-and-licensing-evaluator-resources/customization-and-professional-services/can-i-request-a-feature). This doesn't *guarantee* it will get built, but if it looks like something lots of customers want (judged by votes) then it is likely to get picked up by someone.


author: Javier T?vara
body: Created <https://jira.atlassian.com/browse/CONFSERVER-56330>


Tags: cloud

confluence-cloud

content-by-label

documentation