Hiding comments when disabled

Answered

3 Comments

  • David Raboy
    Comment actions Permalink

    Hey Brian,

    I think I found a way to do this using the curlybar helpers.  Upon initial testing this seems to work, but make sure to play around with it.  Like make sure to test articles that allow comments vs do not allow comments and or already have comments.

    The helpers don't seem to have a specific check that you can do to make sure comments are on/off, but if you hide them inside one of the helpers that does automatically check you can accomplish what you want without too much customization.

    So, as you saw, go into your article_page.ebs file.

     

    In this file there are a few sections of the code we'll change/update.

    Let's wrap a form around the Header. This should remove the "Comments" bold header if comments are not allowed.

    Next, below is highlighted a line of code and move it from above the #if to underneath. This will remove your count of articles if there are no comments.

    Before:

    After;


    Lastly, below we'll change some code and move the "comment_callout" up inside the form as follows. This should only show up if comments are allowed. You can comment out the original like I did below if you want to preserve it. Also, this just places text right at the bottom of the textbox.  Feel free to format as needed.



     Let me know how it goes!  I can also post the full file if you want.

    1
  • Brian Wagner
    Comment actions Permalink

    Worked beautifully!  

    Thanks.  

    0
  • Nicole - Community Manager
    Comment actions Permalink

    Glad to hear you got the answer you needed, Brian. 

    Thanks for sharing your answer, David! 

    0

Please sign in to leave a comment.

Powered by Zendesk