btech
Total posts: 30
11 Mar 2014 04:38

hi

how can we display comments in records listing page

currently i can get cooments on record details page but i need it on records listing page too

using ccomment compojoom as comments adapter

screen

thanks

Last Modified: 01 Oct 2014


Sergey
Total posts: 13,748
11 Mar 2014 09:04

You cannot show comments in article list view. that will be much and slow down page load.


btech
Total posts: 30
12 Mar 2014 10:38

thanks for your reply sergey

can you please guide me how can i show comments as this is required

as far as page load is concerned i have to display limited articles (latest 10)

will page load increases with that or will be affordable

regards


Sergey
Total posts: 13,748
12 Mar 2014 11:48

I am not absolutely sure because i did not test it but you can try this.

echo CommentHelper::listComments($this->submission_types[$item->type_id], $item);

btech
Total posts: 30
12 Mar 2014 12:05

it works partially

scree2

but on clicking the button redirects me to article details page

thanks


Sergey
Total posts: 13,748
12 Mar 2014 12:10

That is because CComments system is not designed that it shows few times on the same page.

This simply will not work. I do not know how to help you here. May be you can run custom SQL queries in custom CObalt template to chow list of comments.


btech
Total posts: 30
12 Mar 2014 12:12

ok thanks


btech
Total posts: 30
13 Mar 2014 07:12

hi sergey

i am using custom queries and get comments result like

screen

can you help me to get simple comment, no irrrelevant short codes etc

thanks


Sergey
Total posts: 13,748
13 Mar 2014 07:33

Put code throu content prepare.

echo JHtml::_('content.prepare', $comment);

Where $comment is comment text.


klox7 VIP
Total posts: 914
21 Sep 2014 16:58

I'm also interested in this. I have record and Cobalt types as comments. In Cobalt types as comments I would like to use Cobalt Built in comments as replies. Comments as full article are closed so I display them only as list.

Can I add an option to post reply to Cobalt types as comments with Built in comments in records list? And then also display this reply in records list of comments?


Sergey
Total posts: 13,748
22 Sep 2014 02:06

Try the same code recomended by me above.


klox7 VIP
Total posts: 914
26 Sep 2014 17:21

I can't get it to work:S

I'm also trying with this but nothing

<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('comment');
$query->from($db->quoteName('#__js_res_comments'));
$query->where($db->quoteName('comment'));
$db->setQuery($query);
$review_reply = $db->loadResult();
echo $review_reply; 
?>

Sergey
Total posts: 13,748
29 Sep 2014 07:28

Somethign like this.

<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('comment');
$query->from($db->quoteName('#__js_res_comments'));
$query->where('record_id = '.$item->id);
$db->setQuery($query);
$review_reply = $db->loadObjectList();
foreach($review_reply as $comment) {
    echo %comment->comment;
}
?>

klox7 VIP
Total posts: 914
29 Sep 2014 08:44

Thank you. Where can I found number of commments in record. In js_res_record there is comments column but it has value 0. What is this column for?


Sergey
Total posts: 13,748
01 Oct 2014 02:28

This column stays for number of comments. But unfortunately it does not work with all adapters. Only with core and cobalt type as comment. May be some other I do not remember. But not all. I do not think CComments support this.

Powered by Cobalt