I needed to do the exact same thing.
1. First of all you may already know that the display of yvcomments may be ommited for certain section(s).
These can be set-up in the the Plugin Manager --> yvcomment --> List of Sections IDs which may, or may not, contain comments.
2. It was not enough for me either, so I set up a new parameter for my articles in the following file: /administrator/components/com_content/models/article.xml
Let's add a custom parameter into the advanced group as follows:
param name="show_comments" type="list" default="1" label="Show Comments" description="Show Comments?">
You may want to have a spacer right after this parameter:
<param name="@spacer" type="spacer" default="" label="" description="" />
Note the />
at the end of this parameter!!!
Your articles will be saved with this custom parameter. You only need to change it if you don't want to display the comments for an article, since your default value = 1.
3. Now let's set up yvcomment to know about our custom parameter:
This will be done in the following file:
The global $yvComment;
object at the beginning of the file holds all information needed for this component (including your article and its parameters)
Let's create a JParameter object from the article parameters:
$articleparams = new JParameter($yvComment->_article->attribs
Now let's get your custom parameter into an if....else statement:
<?php if ($articleparams->get( 'show_comment' ) : ?>
<?php endif; ?>
That's about it!
Best of luck!