Prevent users from posting in community topic?

回答済み

8 コメント

  • Nicole - Community Manager
    コメントアクション Permalink

    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. 

    0
  • Dylan Douglas
    コメントアクション Permalink

    That's what I figured.  I think we'll just post in the KB for those situations and avoid the forums.  Thanks.

    0
  • Nicole - Community Manager
    コメントアクション Permalink

    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. 

    0
  • Florian Merker
    コメントアクション Permalink

    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!

    0
  • Maggie Ungerboeck
    コメントアクション Permalink

    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

     

     

    0
  • Florian Merker
    コメントアクション Permalink

    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 error
    not possible to access `topic` in `topic.id`
     
    Please advise. Thank you!
    0
  • Maggie Ungerboeck
    コメントアクション Permalink

    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

     

    0
  • Florian Merker
    コメントアクション Permalink

    It did! Thank you! :-)

    0

ログインしてコメントを残してください。

Powered by Zendesk