-
AuthorPosts
-
May 12, 2010 at 9:57 am #151015
Hello,
is there a possibility to show comment count next to the title on the front page and on category and section layouts?
It should be shown like this: Article title (comment count, if there are more than zero comments)
I use JComments commenting system. There’s a guide on how to do it here: http://www.joomlatune.com/jcomments-developers-manual.html#jcomments_get_comments_count
But it doesn’t seem to work in JA Teline III. I would be really grateful if anyone could at least point me to the right direction.Thanks in advance,
Mindaugas
May 14, 2010 at 9:57 am #343585I’ve figured this one out. It seems that the suggested function couldn’t get the article id.
Here’s how I made it work:
<?php $id = JRequest::getVar('id'); ?>
<?php $comments = JPATH_BASE .DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$count = JComments::getCommentsCount($id, 'com_content');
echo "($count)";
}
?>
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
May 14, 2010 at 10:33 am #343595Hi Mindaugas,
We do not support this feature, because there is no way to place a comment quantity next to the article title
(joomla is not allowed add any html tags or script to article’ title).Best regards,
ThanhNVMay 14, 2010 at 10:45 am #343597<em>@thanhnv 178565 wrote:</em><blockquote>Hi Mindaugas,
We do not support this feature, because there is no way to place a comment quantity next to the article title
(joomla is not allowed add any html tags or script to article’ title).Best regards,
ThanhNV</blockquote>But I’ve added the code that I’ve posted above and it seems to work. Am I missing something?
May 14, 2010 at 11:10 am #343602And for the category or section view I use this function:
<?php $comments = JPATH_BASE .DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$count = JComments::getCommentsCount($this->item->id, 'com_content');
echo $count ? ('('. $count . ')') : '';
}
?> -
AuthorPosts
This topic contains 7 replies, has 3 voices, and was last updated by Saguaros 14 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum