The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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

TAGS
AUG Leaders

Atlassian Community Events