Leave a Comment

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Jul 17, 2014 2:50 am
Reply with quote
Report this post
Hi,

Is there a way to disable "Leave a Comment" title only on certain categories.
I disabled comments on K2 categorie configuration and the comment form disapeared but the title don´t.

In another post someone sugested to use css override, but this way the title disapear in all itens and i want it to show in one categorie of my site.

Thanks in advance.

Semedo
--
Jommla 3.x
http://www.asterisco.com.pt/infancoop/
User avatar
Junior Boarder

GK User
Thu Jul 17, 2014 6:52 am
Reply with quote
Report this post
User avatar
Moderator

GK User
Thu Jul 17, 2014 3:15 pm
Reply with quote
Report this post


Humm... in is this particular situation (comment title) i think it´s a programming problem in the template, because in other gk templates i just need to disable the comments via K2 categorie configuration in one categorie and the title and form only disapear in that categorie. Maybe this can be resolved with an if statement in the php code!

In my other post
https://www.gavick.com/forums/startup-joomla3/left-margin-after-disable-date-37784.html?p=187261#p18726
i think it's a CSS problem that can be resolved with an expandable or collapsed DIV, because setting the display to none and margin left to 0 (like sugested in https://www.gavick.com/forums/startup-joomla3/want-to-remove-the-date-and-justify-the-text-to-the-left-20761.html) will disable the date in all k2 itens and articles.
User avatar
Junior Boarder

GK User
Thu Jul 17, 2014 3:53 pm
Reply with quote
Report this post
Well,

Deeping in the template code i found the solution to the comment title problem.

In file ../gk_startup/html/com_k2/templates/default/item.php i replaced the following CODE:

Code: Select all
<h3 class="titleComments"> <?php echo JText::_('K2_LEAVE_A_COMMENT') ?> </h3>
<?php if($params->get('commentsFormPosition')=='below' && $params->get('itemComments') && !JRequest::getInt('print') && ($params->get('comments') == '1' || ($params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
<div class="itemCommentsForm">
<?php echo $this->loadTemplate('comments_form'); ?>
</div>



and replaced it with

CODE:
Code: Select all
<?php if($params->get('commentsFormPosition')=='below' && $params->get('itemComments') && !JRequest::getInt('print') && ($params->get('comments') == '1' || ($params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
<h3 class="titleComments"> <?php echo JText::_('K2_LEAVE_A_COMMENT') ?> </h3>
<div class="itemCommentsForm">
<?php echo $this->loadTemplate('comments_form'); ?>
</div>


I just change the position of the "Comment title" from outside to inside of the if statment and it works fine now!

Thanks anyway.

Semedo
User avatar
Junior Boarder

GK User
Thu Jul 17, 2014 5:28 pm
Reply with quote
Report this post
Ok, thanks for the info - I'll provide it to our devteam.
If you would be able to somehow inject category ID or something as a class to a body element - then you could create a css declaration that for given classes allows to show/hide/modify any element. But as I'm only WP developer I can't provide you a detailed information how to do it in Joomla.
User avatar
Moderator


cron