Hide custom text from specific groups

Summary

To display text only for specific user groups.
In this example, we are using groupID 999 which is the Guest Group.
1
<script>
2
if(activeInfo.user.groupID !== 999){
3
var cssSettings = `
4
.hidden-for-non-guest {
5
display: none;
6
}
7
`;
8
$('#guest-css').html(cssSettings);
9
}
10
</script>
11
<style id="guest-css"></style>
12
<div class="hidden-for-non-guest">
13
<h1>You're a guest. Please log in!</h1>
14
</div>
15
This is text everyone sees.
Copied!

Steps

Open the Tab Editor and go to Homepage Items then finally select Custom HTML
Next you will Click which Custom HTML segment you want to use and Enableit then change the Minimum Authentication to the group you want to allow to see it. Next you will copy the code from above and paste it into the box at the bottom. Finally hit the
💾
button.

Outcome

A User who is logged in

A User who is not logged in

Last modified 1mo ago
Export as PDF
Copy link