Keyword

Show number of comments when not logged in

  • Bart Coenen
  • Bart Coenen's Avatar Topic Author
  • Visitor
9 years 7 months ago #132818 by Bart Coenen
Show number of comments when not logged in was created by Bart Coenen
Hi,

I enabled comments only for registered users. The result is that when a user is not logged in, he does not see the number of comments or the invitation to post one below the article intro. I want to show this (number or invitation) to all the users, also when they are not logged in. Is there a way to make this possible?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 7 months ago #132819 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Show number of comments when not logged in
You need to override your template.

In category_item.php locate the following block of code
<?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>

And change it into this
<?php if($this->item->params->get('catItemCommentsAnchor') &&  ($this->item->params->get('comments') == '1')) : ?>

This post will help you with the process.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Bart Coenen
  • Bart Coenen's Avatar Topic Author
  • Visitor
9 years 7 months ago #132820 by Bart Coenen
Replied by Bart Coenen on topic Re: Show number of comments when not logged in
Thank you for the quick response. I changed the code on mysite.be/mytemplate/html/comk2/default/category_item.php but this does not have the desired result (it seems to do nothing). Do I have to change it elsewhere as well?

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #132821 by Lefteris
Replied by Lefteris on topic Re: Show number of comments when not logged in
@Bart Coenen

Ensure that you are using the latest version of K2. Also check that you do not have any custom template overrides.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum