This came up in the community Q/A and thought others could make use of this:
As Brian in the above asked. What if you have disabled comments on an article, but you want to remove the default header and additional information that shows in the default Copenhagen theme?
for example if you have an article with no comments and it's disabled the information shows anyway:
I figured out a way using the curlybar helpers.
The below will hide all the above if comments on a specific article if comments are disabled and should show if it is enabled. Also comments that were previously entered should also show even it's disabled but remove the additional text.
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.
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.
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.
Please sign in to leave a comment.