Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide one entry in the top menu bar in Confluence?

Lara Weber
Contributor
August 25, 2023

Hello together,

How can I hide the entry "Collections" in Confluence for example via CSS (JavaScript, etc.)?

Can someone give me a code for it?

Thank you in advance.

Kind Regards,

LaraTop Menu Bar.png

1 answer

1 accepted

0 votes
Answer accepted
Sayed Bares _ServiceRocket_
Community Champion
August 25, 2023

@Lara Weber you will need to use Javascript to hide elements in Confluence Server/DC.

You will need to go to Confluence Administration > Custom HTML and add the following code in the header:

<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#<id-of-collection>').hide();
});
</script>

Make sure to replace  <id-of-collection> with the ID of the Collections element.

To find the ID of any element you may refer to Find an HTML ID or Name 

Lara Weber
Contributor
August 28, 2023

Hi @Sayed Bares _ServiceRocket_ ,

As you can see in the screenshot there is no ID for the button "Collections".Collections.png

 

Instead of the code you posted, therefore I tried the follwing. With this code the button is hidden.

<script>$(document).ready(function(){
$("a[href='/snapshots/collections/viewer/global.action']").parent().hide()});
</script>  

Thanks.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.4.1
TAGS
AUG Leaders

Atlassian Community Events