Restrict end users from posting to certain topics

8 Comments

  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    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
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    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

    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
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    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
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    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 :)

     

    1

Please sign in to leave a comment.

Powered by Zendesk