Restrict end users from posting to certain topics
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!
-
Hi Mike Davis, I think you should try once to choose the signed-in users option,
-
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.
-
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
{{#if signed_in}}
<style>
.nesty-panel li:nth-child(3) {
display: none !important;
}
</style>
{{/if}}
Note: :nth-child(3), you can change the topic number which you want to hide in the dropdown -->
Screenshot:Let me know if solves your query :)
Thanks
-
Thanks for the hack, Ifra! I'll work with our team to see if that indeed solves our conundrum. Many thanks for the help.
-
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?
-
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
-
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
-
Hi Melissa Lucore, I tried for multiple IDs and got the solution:-
{{#isnt topic.id 000000000}} For First topic ID
{{#isnt topic.id 11111111}} For second topic ID
{{#isnt topic.id 22222222}} For third topic ID
<span class="post-to-community">
{{link 'new_post' topic_id=topic.id class='button button-large'}}
</span>
{{/isnt}}
{{/isnt}}
{{/isnt}}If any query feel free to ask :)
Vous devez vous connecter pour laisser un commentaire.
8 Commentaires