Hide Login in Confluence Dashboard

Hi,

How do I hide just the login (at the top right hand corner) in Confluence Dashboard from anonymous users?

Thank you.

6 answers

1 accepted

1 vote

Hey Tet, I found the following Custom HTML from another Atlassian Answer that another person created:

 

This script works for the "Demonstration Space" (which has a spaceKey of "ds") that ships wiith Confluence

Browse to Confluence Admin | Look and Feel | Custom HTML

In At the end of the HEAD, paste:

<script>
  AJS.toInit(function($){
    if (AJS.params.spaceKey == 'ds') {
      $('#login-link,#browse-menu-link').parent().hide(); // Hide the login & browse menu
    }
  });
</script>

Then Save.

Change the 'ds' bit to whatever the spaceKey is for your space.

 

2 votes
Stephen Deutsch Community Champion Aug 13, 2015

This should work:

<script>
  AJS.toInit(function() {
    if (AJS.params.remoteUser == '') {
      AJS.$('#login-link').hide();
    }
  });
</script>

This is the one that worked for me

0 vote
Stephen Deutsch Community Champion Aug 12, 2015

The script that Guilherme linked to will block the login link for a particular space, but not from the dashboard.

This would probably work better:

<script>
  AJS.toInit(function($){
    if (document.location.href.indexOf("dashboard.action") !== -1) {
      $("#login-link").parent().hide(); // Hide the login menu
    }
  });
</script>

Hi Stephen,

 

I tried your method but it does not work.  Actually I also tried this script which is working but it hides the whole menu bar from anonymous users:

<script>

  AJS.toInit(function() {

  if (AJS.params.remoteuser == '') {

  AJS.$('header').hide();

}

});

</script>

 

How do I modify this script to just hide the login button in the menu bar.  I would like to leave the rest (eg. quick search textbox) visible.

Thank you

Thank you!  It works!

This worked for me as well! 

Thanks! Perfect solve.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted yesterday in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

93 views 3 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you