Remove the follow button on my Help Center articles Follow

Comments

4 comments

  • Avatar
    Zivbs

    Hello.

    We'd like to have the follow button for but a handful of our articles.

    Any suggestions on how this can be accomplished programmatically?

     

  • Avatar
    Trapta

    Hi @Zivbs, copy and paste the below code at the bottom of your article template -

    <style>
    .article-subscribe,
    .article-unsubscribe {display: none;}
    </style>

    <script>
    var _articles = [ID, ID];

    if ( _articles.indexOf({{article.id}}) == -1 ) {
    $('.article-subscribe').show();
    $('.article-unsubscribe').show();
    }
    </script>

    Replace ID with the IDs of articles you want to hide follow button.

    Let me know if you face any issue.

    Thanks

  • Avatar
    Zivbs

    Thanks @trapta

    Since the goal for this was to be able to update users on article updates I thought of a more elegant solution. Now the follow button is only displayed for articles that are open for comments. Here it goes (article page):

    {{#unless article.comments_disabled}}
    {{subscribe}}
    {{/unless}}

    Also use {{#unless article.comments_disabled}} to wrap around the whole comments section in the same page.

    Cool, huh? 

  • Avatar
    Trapta

    @Zivbs , Yeah right.

Please sign in to leave a comment.

Powered by Zendesk