I
I
Ilyaploskov2019-09-04 13:00:55
Joomla
Ilyaploskov, 2019-09-04 13:00:55

How to display the RSComments comment count?

I use the RSComments! component on the sites. Using a shortcode, you can display the comment count of any article, anywhere. For example: {rscomments_no option="com_content" id="62"}
I need to insert this shortcode into the template (joomla/content/info_block/hits.php file), into this piece of code, where the number of views is displayed:

?>
      <dd  class="hits"> 
      <span class="icon-eye"></span>
          <meta itemprop="interactionCount" content="UserPageVisits:<?php echo $displayData['item']->hits; ?>" />
          <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $displayData['item']->hits); 	
?>

The id of the current article should be substituted in id="62". It didn't work out on its own.
Another question, will it work at all? After all, joomla/content/info_block/hits.php is not html/com_content/article/default.php , the shortcode has com_content

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question