By Joomlafans on Saturday, 11 August 2018
Posted in Technical Issues
Replies 7
Likes 0
Views 809
Votes 0
Hi.
How can I hide the Komento comments counter in Joomla articles when there are 0 comments? so that it only appears after comments are posted.
In order to achieve this, you have to modify this file JoomlaFolder/components/com_komento/themes/wireframe/listings/default.php

[gist type="php"]
<?php if ($this->config->get('layout_frontpage_comment')) { ?>
<li class="kt-listing-comment">
<a href="<?php echo $componentHelper->getContentPermalink() . '#comments'; ?>">
<i class="fa fa-comments-o"></i> <?php echo $commentCount;?> <?php echo JText::_('COM_KOMENTO_FRONTPAGE_COMMENT');?>
</a>
</li>
<?php } ?>
[/gist]

Replace with
[gist type="php"]
<?php if ($this->config->get('layout_frontpage_comment') && $commentCount >= 1) { ?>
<li class="kt-listing-comment">
<a href="<?php echo $componentHelper->getContentPermalink() . '#comments'; ?>">
<i class="fa fa-comments-o"></i> <?php echo $commentCount;?> <?php echo JText::_('COM_KOMENTO_FRONTPAGE_COMMENT');?>
</a>
</li>
<?php } ?>
[/gist]
·
Saturday, 11 August 2018 23:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello.

This did not work for me. in-fact nothing happened even when I removed the /listings/ directory all together. I changed komento theme to wireframe just incase but that stil didn't do anything.

However I did see change when I applied the above in

components/com_komento/themes/wireframe/structure/default.php


<?php if ($this->my->allow('read_comment') && $commentCount >= 1) { ?>
<div class="kt-title-bar">
<div class="o-grid">
<div class="o-grid__cell o-grid__cell--center">
<h3 class="kt-title-bar__title">
<?php echo JText::_('COM_KOMENTO_COMMENTS'); ?> (<span class="commentCounter" data-kt-counter><?php echo $commentCount; ?></span>)
</h3>
</div>

<div class="o-grid__cell-auto-size o-grid__cell--center">
<?php if ($this->config->get('enable_ratings')) { ?>
<?php echo $this->output('site/ratings/overall'); ?>
<?php } ?>
</div>
</div>
</div>


But then after doing that I started getting the following error with the comment submit button.
Uncaught TypeError: Cannot read property 'insertRow' of undefined.

I changed everything back to its default value until further support.
·
Sunday, 12 August 2018 17:09
·
0 Likes
·
0 Votes
·
0 Comments
·
That is strange, unless you have template override for this file from your current template directory folder so it doesn't show any effect on the page.

Can you check this file location and see whether your current template did override this file?

JoomlaFolder/templates/YourCurrentTemplate/html/com_komento/listings/default.php

If don't have, perhaps you can update your following details at http://stackideas.com/dashboard/site so we can better have a check.

- Joomla backend access
- FTP access
·
Monday, 13 August 2018 10:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello. I have updated this post with admin login and FTP info. kindly have a look.
·
Thursday, 13 September 2018 20:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

Are you referring Joomla article single page? e.g. http://www.lutsberg.com/en/2-article-en-gb

If yes, I've applied some custom code from this file /public_html/components/com_komento/themes/wireframe/structure/default.php , it shouldn't show that comment count at the top if there no any comment added in this article.

What i provided that suggested code in earlier is only affect on the article listing page http://take.ms/cuu13

Can you give it a check and see whether this is what you want?
·
Friday, 14 September 2018 11:42
·
0 Likes
·
0 Votes
·
0 Comments
·
It works perfectly now! thank you.

Would you be so kind as to tell me what code did you replace and with what? so I can have a better understanding for future websites using Komento.
·
Friday, 14 September 2018 16:04
·
0 Likes
·
0 Votes
·
0 Comments
·
You're most welcome, this is what i did into your site http://take.ms/AAlK3 .
·
Friday, 14 September 2018 17:25
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post