Issue using Content by Label Macro
Asked by Rob St-Germain:

here are the facts:  
- I have two confluence pages: DOC and LIST.  
- I have a pdf document called PDF1 in Confluence DOC page.  
- I added label called L1 to the pdf document PDF1 in the Confluence DOC page.  
- Confluence DOC page itself has no labels.  
- In the Content by Label Macro editor, I insert the L1 label in Confluence LIST page.  
- the Content by Label Macro preview shows the link format as "Confluence DOC page \> PDF1".  
- There are no checks in the check boxes for "show labels for each page" and "show space name for each page".  
- I would like the link format to be just "PDF1" and omit the page name. Help !


Answers:
author: Maltavius
body: Content by Label macro links to Pages, it is what it does.

Have you tried checking "Exclude current page", that might remove the link entirely.

Not sure what you are after, but does the Attachments Macro do what you want?

comments: author: Rob St-Germain
body: Thanks, but there is no checkbox option for "Exclude current page" in the Content by Label macro in the cloud version of Confluence. Also I don't see an Attachments macro in the cloud version of Confluence.


author: Shannon S
body: Hello Rob,

Thank you for raising this, and I hope you are well!

As [@Maltavius](/t5/user/viewprofilepage/user-id/3914380) mentioned, the [Content by Label](https://support.atlassian.com/confluence-cloud/docs/insert-the-content-by-label-macro/) macro will always display the name of the page which contains the attachment first, so your users know where to find the specific attachment.

For you, the **Attachments Macro** is the best route, and I can confirm that this macro is currently available in Confluence Cloud. You can review how to add it to a page by following the documentation on [inserting the Attachments macro](https://support.atlassian.com/confluence-cloud/docs/insert-the-attachments-macro/).

Regarding the feature to exclude the current page, this is a newer feature in Confluence Server, and it hasn't been added to Confluence Cloud at this time. The Server version of this request has since been closed, but you can find the open Cloud request below:

* [CONFCLOUD-5245](https://jira.atlassian.com/browse/CONFCLOUD-5245?) *Option to exclude current page in results when using contentbylabel* macro

If you're ever looking to exclude a page in the future, there's a workaround [provided by a customer in the comments](https://jira.atlassian.com/browse/CONFCLOUD-5245?focusedCommentId=2381937&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2381937):
> For those who don't know, the most viable workaround, which I called "negation of the page title" above, is to set the "With title" filter to have a value of **!"Your Page Title Here"**

I understand that it's not ideal, since the page name can still be changed, but it should work in a pinch.

Let me know if you have any trouble with the Attachments macro; I'm happy to help.

Regards,

Shannon

comments: author: Dennis T
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046), the workaround doesn't function any more on Cloud.

That goes for all flavors of it, i.e., !"Current Page Title", -Current+Page+Title, !Current+Page+Title, -"Current Page Title". This is why people hate Atlassian. The workaround gets nixed but the issue doesn't get fixed. Make sure you don't affect workarounds if you're not going to fix the issue being worked around. Ugh.


Tags: cloud