Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Site-wide banner to anonymous users only

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

2 votes
Answer accepted

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! 

That worked, thanks boss!

Thanks a lot, working like a charm !

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

8,592 views 7 7
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you