Is there a way to disable the Create Post function in Groups? I see the ability to disable comments on articles posted in there, though a client is wondering for their use case, if members of their group can be prevented from creating posts in there.
If you choose to go down the route of custom script you can:
- Remove the dropdown for that group within the new topic page:
You could however do a bit of coding to achieve this such as:
<script>
if (inSidedData.page.url.includes("/topic/new")) {
document.onclick= function(event) {
if (event===undefined) event= window.event;
for (let i = 0; i < document.getElementsByClassName("optgroup").length; i++) {
for (let j = 0; j < document.getElementsByClassName("optgroup")pi].children.length; j++) {
var categoryTitle = document.getElementsByClassName("optgroup")pi].children.j];
if (categoryTitle.innerText === "CATEGORY/ GROUP TO REMOVE HERE") {
categoryTitle.classList.add("dont-show");
}
}
}
};
}
</script>
With Custom CSS:
.dont-show {
display:none;
}
But you might want to select which custom roles can and cannot post in that specific category or group so adding the following around your script to select what role to execute this for:
<script>
if (inSidedData.user.role == 'CUSTOM ROLE NAME HERE') {
// INSERT SCRIPT TO EXECUTE HERE
}
</script>
- Remove the Create Topic button from a given group
Simply using this short script to assign the same CSS class listed above
<script>
if (inSidedData.page.url.includes("groups/END OF GROUP URL")) {
var groupCreateTopic = document.getElementsByClassName("create-group-topic-btn")t0];
groupCreateTopic.classList.add("dont-show");
}
</script>
Note: I encountered some difficulty due to the list of categories being generated each time it is open, so the entire script above is triggered each time a user clicks somewhere on the new topic page… There might be a better way to do this but this works nicely if you need it!
Hope this helps!
Hi
The solutions
- To open up Custom CSS, please click on Theme once you are logged in as admin and click on Custom CSS
- You will get a section on the right hand side to enter in custom code, use the following snippet.
.group-details_hero__user-actions .create-group-topic-btn {
display: none;
}
Hopefully this helped!
Sincerely,
Ravi
Thank you
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.