By Justin Throngard on Friday, 16 June 2017
Posted in General Issues
Replies 4
Likes 0
Views 840
Votes 0
Is there a way to hide the Comment Counter in Easyblog/Komento if there are 0 comments? Only show the counter if there are comments?
Hello Justin,

Unfortunately this isn't configurable currently but you can with a slight tweak alter this behavior. You can edit the file /components/com_easyblog/themes/wireframe/blogs/latest/default.main.php and change line 222 from the following,

[gist]
<a href="<?php echo $post->getCommentsPermalink();?>"><?php echo $this->getNouns('COM_EASYBLOG_COMMENT_COUNT', $post->getTotalComments(), true); ?></a>
[/gist]

To,

[gist]
<a href="<?php echo $post->getCommentsPermalink();?>">
<?php if ($post->getTotalComments() == 0) { ?>
Comments
<?php } else { ?>
<?php echo $this->getNouns('COM_EASYBLOG_COMMENT_COUNT', $post->getTotalComments(), true); ?>
<?php } ?>
</a>
[/gist]
·
Saturday, 17 June 2017 12:55
·
0 Likes
·
0 Votes
·
0 Comments
·
That worked sorta, but not what I need. I need the comment line to not show at all if there are 0 comments. Right now with this change it just says "Comments" and shows the icon.
·
Tuesday, 20 June 2017 00:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Never mind. I made the correct change.

<?php if ($post->getTotalComments() !== false && $this->params->get('post_comment_counter', true)) { ?>
<div class="col-cell eb-post-comments">
<?php if ($post->getTotalComments() == 0) { ?>
<div></div>
<?php } else { ?>
<i class="fa fa-comments"></i>
<a href="<?php echo $post->getCommentsPermalink();?>">

<?php echo $this->getNouns('COM_EASYBLOG_COMMENT_COUNT', $post->getTotalComments(), true); ?>

</a>
<?php } ?>


How can I add this change to the Joomla template override system? I tried making the following directory with the film in: template/html/com_easyblog/themes/wireframe/blogs/latest

But that didn't work.
·
Tuesday, 20 June 2017 01:00
·
0 Likes
·
0 Votes
·
0 Comments
·
You have to use this template override path :

JoomlaFolder/templates/YourCurrentTemplate/html/com_easyblog/blogs/latest/default.main.php
·
Tuesday, 20 June 2017 10:50
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post