Skip to main content
Question

How to create a custom banner to alert users they must login to interact with content?

  • November 30, 2022
  • 4 replies
  • 67 views

ryanne.perry

Hi Community 👋

Does anyone have any examples of how they added a banner to either alert new users or existing users that they must login or create an account to interact with the Community content?

If so, are you able to share the third-party scripting or custom html you used to set it up?

Please and thank you! 

4 replies

DannyPancratz
Forum|alt.badge.img+9
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • November 30, 2022

I haven’t done that, but it’s on my list. 

I have done the opposite with the help of support. They created a third-party script to hide a few HTML widgets I wanted to just show to logged-in users:

HTML Widget
HTML Widget

These are both form-based apps I don’t want to expose to the world. And guest visitors don’t need to know about. 

Their third-party script identified the widget by it’s name, I believe, so I’m guessing they could help you target that to show to only unauthenticated users. 


DannyPancratz
Forum|alt.badge.img+9
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • November 30, 2022

Here’s the third party script in the Before </Body> section

<script>
// script to display CUSTOM POINTS html widget for registered users

if (inSidedData.user.role == 'roles.guest') {
document.getElementById('custom_points_widget').style.display = "none";
}

</script>

My HTML widgets have code to specify the name of the element

<div id="custom_points_widget">

 

Can you use the other widgets like the topic banner? Probably. If you can identify the element ID, they should be able to build a similar script to hide it for roles that are logged-in.


  • November 30, 2022

Isn’t that already built into inSided? What I see when I visit our community and not logged in and then try to interact with content is a pop up prompting me to log in.


ryanne.perry
  • Author
  • Helper ⭐️
  • November 30, 2022

Thanks @DannyPancratz

@Scott Baldwin, yes that is the setup. I was looking for something further than that so they know they must create an account if they are a new user. (trying to make it as clear as possible as we have received feedback that it’s not)

And/or also a phrase that let’s them know they need to activate their notification email to make the approval process go faster.