Keyword

How to hide "Be the first to comment!"

  • Denniss
  • Denniss's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #108668 by Denniss
Hello,

I have the same problem as here:

getk2.org/community/New-to-K2-Ask-here-first/162279-remove-Be-the-first-to-comment-#162279

and here:

getk2.org/community/New-to-K2-Ask-here-first/11724-hide-the--be-the-first-comment-on-articles#11724

Comments for all users are disabled in K2. All comment options in the category parameters are set to “Hide”. It seems to be a bug. Can you check that please? Thank you!

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

More
11 years 8 months ago #108669 by william white
Replied by william white on topic Re: How to hide "Be the first to comment!"
You can:
search the language files for K2_BE_THE_FIRST_TO_COMMENT and give it a value of ""

use firebug to find the div its located in and add display:none to your css code

create an override and remove lines 153. to 170 (code below) of item.php (k2 ver 2.6.2)
and assign the override to the category in question

A link to the page in question would be helpfull

<?php if($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
<!-- Anchor link to comments below - if enabled -->
<li>
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<?php else: ?>
<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</li>

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

  • Denniss
  • Denniss's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #108670 by Denniss
Replied by Denniss on topic Re: How to hide "Be the first to comment!"
Thank you for your prompt reply!

I use a template from Joomlart (JA Mendozite). This is an offline installation with XAMPP. I think I need to look for the error in the template files from Joomlart. Your suggestions would be no clean solution to the problem. So I would hide the text also for articles where the comments are enabled.

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

More
11 years 8 months ago #108671 by william white
Replied by william white on topic Re: How to hide "Be the first to comment!"
I typed 3 different ways to do it.
if you change the text in the language file it will be global
if you change the css - in the k2 directories it would be global unless your template override it, but you could use css4k2 and apply it to only one category
If you edit an override item.php the change will affect only the item view, if you make the same change to category.php in the override it would work there also, but in both instances it would only affect the category that you had the override assigned to.
Creating an override will protect you from losing your changes on upgrade of your template and or k2

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

  • Denniss
  • Denniss's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #108672 by Denniss
Replied by Denniss on topic Re: How to hide "Be the first to comment!"
If I change the text in the language file, the plus-icon before the text remains unchanged.

Your other ways with overrides would be for me as a beginner, too complicated.

I think the template of Joomlart overrides the K2 files because the changes of the css in the k2 directories give no result.

Where does the fault lie, if the text will not be hidden? K2 or is it the template of Joomlart? Maybe the next update will fix it?

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

More
11 years 8 months ago #108673 by chilly_bang
Replied by chilly_bang on topic Re: How to hide "Be the first to comment!"

Your other ways with overrides would be for me as a beginner, too complicated.

template override is not complicated, its a basic for successful using K2 without payed support. excuse my offtop

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

  • Denniss
  • Denniss's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #108674 by Denniss
Replied by Denniss on topic Re: How to hide "Be the first to comment!"
ok, thank you!. In this case it seems to be a bug in the code of K2. Is this for the developers of k2 not interesting?

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


Powered by Kunena Forum