I have an HTML widget that is public to anyone who visits the community home page. I want to make it visible only to members who are logged into the community. It’d be even better if I could make it visible only to a specific user role. Is there a way to do this?
Page 1 / 1
Yes, I did this with the help of support.
You use this third party script in the Before </body> section.
<script>
if (inSidedData.user.role == 'roles.guest') {
document.getElementById('name of your widget').style.display = "none";
}
</script>
For that to work, you need to name your widget in the HTML in the front end HTML widget setup to work
<div id="name of your widget">
the rest of your html code
</div>
Reply
Sign up
If you ever had a profile with us, there's no need to create another one.
Don't worry if your email address has since changed, or you can't remember your login, just let us know at community@gainsight.com and we'll help you get started from where you left.
Else, please continue with the registration below.
Welcome to the Gainsight Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.