How to 'hide' attachments from being displayed when using the Attachments macro?
Asked by Hal West:

I need to 'hide' individual attachments from being displayed when using the Attachments macro, by placing a LABEL on each attachment that I don't want displayed.

Does the Attachments macro support this capability (such as using a '-' in front of the label's name to exclude that attachment from being displayed)?

Is there an alternate means to do this, other than Labels?


Answers:
author: Diego
body: Hello there, [@Hal West](/t5/user/viewprofilepage/user-id/1073796) !

We can actually to the direct opposite of what you described. We can set the Attachments Macro to display only the attachments that contain a specific label.

Here is how:

> 1. *Create a new page*
> 2. *Insert the Attachments Macro*
>    1. *![PageEditAttachments.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/69193i62AA2AB85160030C/image-dimensions/345x174?v=v2 "PageEditAttachments.jpg")*
> 3. *Go into the macro settings*
>    1. *![AttachmentsMacroSettings.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/69194i6C6AB197F60194AB/image-dimensions/325x201?v=v2 "AttachmentsMacroSettings.jpg")*
> 4. *Scroll the fields in the left side until you can see "Attachment labels"*
> 5. *There, we will need to define all the labels that can be shown*
> 6. *Save the settings*
> 7. *Publish page*
> 8. *Go to to the page attachments (three dots menu in the top right corner \> Attachments)*
>    1. *![PageViewAttachments.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/69195iC373524EE52A7976/image-dimensions/323x145?v=v2 "PageViewAttachments.jpg")*
> 9. *Define the same label that you defined within the macro to all the attachments you need to display*
> 10. *Go back to the page view*
> 11. *Check that your attachments are now displaying*

The objective of hiding specific attachments can be achieved. However, instead of defining which labels can not be shown, we select those that can be shown.

Hopes this helps you, Hal!

> Edit:  
> [++**\[Confluence Server\] Attachments Macro**++](https://confluence.atlassian.com/doc/attachments-macro-97911315.html)

comments: author: Hal West
body: Hi Diego,

Thanks for your answer. It seems to describe standard and well-known functionality of the Attachments macro. However, your answer does not meet our need.

In our case, multiple parties will be attaching files to multiple pages 'without applying labels', and these files will be made visible on a single page containing the Attachments macro. As leadership approves each attached file, they will apply a 'reviewed' label to the file and they want that file to 'drop off' of the list of files shown by the Attachments macro (though each file itself remains attached to its original page).

Can the Attachments macro be made to 'remove' files from visibility which have certain labels? If not, can Atlassian update the macro with this capability? (we would want that!)

Thanks,  
Hal


author: Jana Rauland
body: Dear Hal,

I hve exactely the same issue. Did you find a solution in the meanwhile?  
Thanks for supporting.

Kind regards,   
Jana


author: Hal West
body: Hello Diego, et al.

Can you please provide an answer or resolution to the above inquiry? I have not yet received a complete answer.

Hal


author: Diego
body: Hello there again [@Hal West](/t5/user/viewprofilepage/user-id/1073796) !

Thank you very much for explaining further. Now I believe that I completely understand your needs.

What we need is to display solely attachments that have no labels, correct? Currently, this is not possible with the Attachments macro.

This improvement has been listed here, for both Confluence Server and Cloud:
> * [++***\[Confluence Server\] Confluence Attachment Macro should able to list only attachments without label.***++](https://jira.atlassian.com/browse/CONFSERVER-41419)
> * [++***\[Confluence Cloud\] Confluence Attachment Macro should able to list only attachments without label.***++](https://jira.atlassian.com/browse/CONFCLOUD-41419)

Since there is no preview of when or if this will be implemented, the best course of action is to vote and watch the report.

The possibility of filtering out specific labels has also been suggested a few years ago but was ultimately ruled out by Atlassian. You can check the request here:
> * [++***\[Confluence Server\] Allow for the Attachments Macro to filter out specific labels***++](https://jira.atlassian.com/browse/CONFSERVER-32728)
> * [++***\[Confluence Cloud\] Allow for the Attachments Macro to filter out specific labels***++](https://jira.atlassian.com/browse/CONFCLOUD-32728)

Again, thanks for keeping the thread alive.


author: Hal West
body: Hi Diego,

Thanks for the update. I realize this is a 'feature request' - but a good one.

I'm generally unhappy with Atlassian's lack of promptness to address certain 'bugs' and 'issues' in their tools, allowing them to exist for years, even if there haven't been hundreds of complaints. But this is a feature, not an issue.

I hope this feature request can be implemented soon, as it's a real need, sensible and logical, and the original creator of the Attachments macro probably should have included the capability to 'display' or to 'not display' attachments with any listed labels.

Best regards,  
Hal


Tags: questions-for-confluence