Recent searches
No recent searches
Restrict end users from posting to certain topics
Answered
Zendesk LuminaryUser Group Leader
Posted Mar 29, 2022
Hi all!
I'm struggling to find out if it is possible, and if so, how to restrict end users of your community from posting to certain topics. For example, we have a topic is setup to be visible to signed-in users. The topic is also set to allow agents and admins to manage it. However, while I want end users to see it when signed in, I don't want then to be able to choose it when creating a post themselves. Is there way to prevent that using segments today and have I missed it? Open to suggestions on how to achieve this. Thanks!
0
12
12 comments
Ifra Saqlain
Hi Mike Davis, I think you should try once to choose the signed-in users option,
0
Mike Davis
Hi Ifra Saqlain! Thanks for the follow-up. So my setup today is that User segment is set to Signed-in users and Who can manage posts? is set to Agents and Admins. I can't seem to prevent a signed-in end user from picking this topic when creating a post, however.
0
Ifra Saqlain
Mike Davis, you can hide the topic from the dropdown list on new_post_page. See what I did:-
Template Name: new_community_post_page.hbs
I'm hiding the topic in the dropdown for the signed-in users, they can see the topic on topic-list-template but when they couldn't make a post under this topic.
Code: Add the below code at the bottom
Let me know if solves your query :)
Thanks
0
Mike Davis
Thanks for the hack, Ifra! I'll work with our team to see if that indeed solves our conundrum. Many thanks for the help.
0
fkrugerx
I got this to work, however, when you open the relevant topic page, there is a 'New post' button. When you click the button, the topic is displayed, by default, in the topic box, but disappears when you drop down the topics. It seems that if you do not drop down the topics, you can post to the relevant topic.
Is it possible to also disable or hide the New Post button for a particular topic?
0
Ifra Saqlain
Hi fkrugerx,
Do the following:-
i). On preview mode, click the topic you want to hide the 'New post' button for that.
ii). You will redirect to that topic page and then copy the topic ID from the search-bar.
iii). Check the topic ID on 'community_topic_page.hbs' file. See the given screenshot of how I did.
iv). Replace '000000000' with your topic ID which you have copied from the searchbar.
v). When you have done, preview and test, and if any issues let me know.
Thanks
Team
0
Melissa Lucore
Hi Ifra Saqlain - How would I hide multiple topics using this code? I was able to hide the button from 1 topic as shown above, but not sure how to list multiple topics to hide the post button from.
Thanks,
Melissa
0
Ifra Saqlain
Hi Melissa Lucore, I tried for multiple IDs and got the solution:-
If any query feel free to ask :)
1
Ivan
Hi Ifra Saqlain, your contributions around the community are always very helpful, and this one is no different. Thank you for being a great contributor.
I do have a question. In my case, it looks like {{#if signed_in}} applies the condition to Admins as well it hides the topics in the .nesty-panel, thus blocking us admins from posting in those topics.
Do you have a suggestion to make all topics available in the .nesty_panel for Admins regardless of any restrictions for end-users? I'm using theme version 1.0.0 with jQuery. Thanks in advance.
0
Ifra Saqlain
Hey Ivan, thanks for the
,
you can set User Segment for the topic visibility.
Go to the Arrange topics:
And select that topic which you wanna hide from end-users:
Let me know if it solves your query :)
0
Ivan
Thanks, Ifra Saqlain We are getting odd behavior. We have 4 topics and we are looking to accomplish the following for each topic.
The Who can manage posts setting is set to Agents and admins for all topics. Yet, when the .nesty-panel li:nth-child(#) styling is applied to topics 2 and 3, it removes topics 2 and 4 from the list for admins.
I'm not good with code at all, everything I've done has been by following suggestions in this community. But I'm wondering if a condition that states "Unless the user is an admin, users cannot post in topics 2 and 3" would be better in my case.
0
Ifra Saqlain
Hey Ivan,
You can try the followings, (Not tested):
i). Go to the new_community_post_page.hbs file and paste the given code at the bottom.
ii). Go to the script.js file and paste the given code at the bottom.
Try this and let me know.
Thanks
0