Prevent users from posting in community topic?
回答済みIs there a way to prevent end-users from posting in a certain community topic? We're trying to create an announcement type of topic where only managers/agents could create a new post. We can already lock existing posts, but we can't create random users from making new posts.
-
Hey Dylan .-
There's no way to do this out of the box, though I know some users have implemented custom code to his the "new post" button from within certain topics. If you're interested in that, we can see if any of our community moderators or other members can help you out with the customization.
-
That's what I figured. I think we'll just post in the KB for those situations and avoid the forums. Thanks.
-
You're welcome. Sorry I don't have a more straightforward answer for you on that one.
You may want to post a request for that kind of functionality in the Gather Product Feedback topic - I suspect there are a number of users who would like to be able to do the same.
-
Hey Nicole, we would like to prevent community users from creating new posts. They should be able to comment on existing posts though. How can we do that? Could you help us with the code? Thanks!
-
Hi Florian,
You can comment out the new_post code in the various community pages. For example, in the community_topic_page.hbs, search for new_post and there are two different blocks of code that include new_post. They look like this:
<span class="post-to-community">
{{link 'new_post' role='button' topic_id=topic.id class='button button-large'}}
</span><h2 class="community-footer-title">{{t 'suggest_new_post'}}</h2>
{{link 'new_post' role='button' class='button-large'}}You can then comment out these pieces of code. It will look like this:
<!-- <span class="post-to-community">
{{link 'new_post' role='button' topic_id=topic.id class='button button-large'}}
</span> --><!-- <h2 class="community-footer-title">{{t 'suggest_new_post'}}</h2>
{{link 'new_post' role='button' class='button-large'}} -->Do that for all the community pages and the New Post button won't display on those pages anymore.
Hope that helps!
Thanks,
Maggie
-
Thanks Maggie!
It worked for me on community_post_page.hbs and community_topic_page.hbs
but did not work on community_post_list_page.hbs and community_topic_list_page.hbs where I'm always getting the error:
1 errornot possible to access `topic` in `topic.id`Please advise. Thank you! -
Hi,
Your commented out code on community_post_list_page.hbs should look like this:
<!--<span class="post-to-community">
{{link 'new_post' role='button' class='button-large'}}
</span>--><section class="container community-footer">
<!-- <h2 class="community-footer-title">{{t 'suggest_new_post'}}</h2>
{{link 'new_post' role='button' class='button-large'}}
</section>
</div> -->And on community_topic_list_page.hbs:
<!-- <span class="post-to-community">
{{link 'new_post' role='button' class='button-large'}}
</span> --><!-- <h2 class="community-footer-title">{{t 'suggest_new_post'}}</h2>
{{link 'new_post' role='button' class='button-large'}}
</section>
</div> -->Hopefully that will fix the error for you.
Thanks!
Maggie
-
It did! Thank you! :-)
サインインしてコメントを残してください。
8 コメント