Site-wide banner to anonymous users only

Nick Martin October 3, 2018

Does anybody have a method to display a site-wide banner to only users not logged in? For example I want to use the method outlined in this article, but I only want anonymous users to see the banner.

https://confluence.atlassian.com/confkb/how-to-add-a-site-wide-banner-165609599.html

2 answers

1 accepted

3 votes
Answer accepted
Mark Bereznitsky
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 3, 2018

Hello,
You can achieve the effect by using the above instructions to add a banner, for example:

 


<div id="banner" class="aui-message closeable" style="display:none;">
<p class="title">
<strong>Error!</strong>
</p>
<p>And this is just content in a Default message.</p>
</div>

And then add some Javascript to display the banner only when the accessing user is anonymous, like this (should go in the after HEAD section):

 

<script type="text/javascript">
AJS.toInit(function(){
if (!AJS.params.remoteUser){
AJS.$('#banner').show();
}
});
</script> 

 

Let us know how you go! 

Nick Martin October 8, 2018

That worked, thanks boss!

0 votes
Serge Colin April 14, 2020

Thanks a lot, working like a charm !

Lauras Susa December 14, 2023

Hello, 

I'm trying it in Data Center version 8.6.2 and for me its doesn't work as expected. It shows banner despite user logged in or not. 

There is my config. What is not correct here or this solution do not works anymore? 

Thank you 

HTML Config.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events