How to disable the banner topic dismiss button for non logged in users only

Continuing the discussion from How to disable the banner topic dismiss button?:

Was checking this thread but still no clear answer to me. My use case is the following: we have a forum( which use invite link for people to get into the forum. New people reaching the forum need to take a small survey(TypeForm) and if they reach certain level by passing that questionnaire, Typeform provides a previoulsly generated invite link for that potential new user to get into the forum automatically.

We setup our forum as invite only and allowing new registrations, so Sign up button dissapeared and we have a banner topic pinned globally where new potential users are “welcomed” and invited to take the survey. The problem is that we want this banner topic non-dismissable for non-logged users but dismissable for logged users…we need to remove the “X” for non-logged in users and keep it for logged in so logged in users can effectively dismiss this once and for all.

How can we achieve this behaviour? Thanks

You can do it with CSS. There are examples of how to find the thing that shows if the user is logged in on a bunch of topics. (What I would do is look for those, as css is still quite confusing to me, so I don’t have an actual answer.)

If you’re in a hurry, you should be able to find an example. Or perhaps someone will provide you with actual code.

1 Like

Thanks @pfaffman!!! I´ve figure it out myself by now:

  • To hide the “X” for not-logged in users:
.anon #banner .close .d-icon{
    display: none;
  • Showing the “X” for users logged in:
#banner .close .d-icon{
    display: block;

Nice work! I hope my non-answer was a tiny bit of help. :wink: