Topic-icon double social buttons & comments box in K2 items

Active Subscriptions:

None
Hi, after installing the latest JFBConnect 6.3.0 all my K2 item pages show double social buttons & comments box without me changing anything.
Here is a screenshot:


File Attachment:
The topic has been locked.
Support Specialist
9 years 3 weeks ago #52294 by mel
We've slightly changed how we're inserting the social widgets through our content plugin in the latest version to use content plugin events. Looking at the source code on your page, it looks like the events for both K2 after display and Joomla after display are getting called on your K2 item pages. Could you tell me which content plugins you have enabled on your site?
The topic has been locked.
Active Subscriptions:

None
9 years 3 weeks ago - 9 years 3 weeks ago #52298 by kappadev
Hi, on backend i have enabled the K2 comments and K2 Like, from what i see nothing else.
Also in the Joomla plugins page i believe i have the usual. See screenshot

* I have sent you a PM with login credentials if you could please have a better look.


File Attachment:
Last edit: 9 years 3 weeks ago by kappadev.
The topic has been locked.
Support Specialist
9 years 3 weeks ago #52302 by mel
It's definitely strange. I've looked through your configuration and didn't see anything vastly different from my test site which has the correct behavior of showing only once. Will you please check your site files to see if there are any template overrides for K2 in /templates/YOUR_TEMPLATE/html/ directory?

-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 3 weeks ago #52328 by kappadev
Hi,

yes there is a template overrides for K2 in my template directory.
I'm no programmer but i'm positive the item.php in there has something to do with it because if i rename it, then i see only once the social buttons and comments box only now it;s on a different position inside the K2 item page.

i've sent you the file with a PM.
If it's not a lot to ask please for you to have a look.

thanks
The topic has been locked.
Support Specialist
9 years 3 weeks ago #52329 by mel
Yes, it looks like your template override has the following block of code twice, which is why you're seeing the double widgets, since you're using the Bottom position setting. Remove one and I believe that will fix your problem easily.
<!-- Plugins: AfterDisplay -->
<?php echo $this->item->event->AfterDisplayContent; ?>

<!-- K2 Plugins: K2AfterDisplay -->
<?php echo $this->item->event->K2AfterDisplayContent; ?>

Please note, that I found another plugin event that was duplicated as well in your template override. If you change the position of the Comments or Share buttons in JFBConnect > Social, you may run into this problem again unless you remove the duplicates
$this->item->event->BeforeDisplayContent;

In general, if you are having problems, compare your template override item.php with K2's file at /components/com_k2/templates/default/item.php to see any glaring or obvious problems.

-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 3 weeks ago #52331 by kappadev
Thank you so much Melissa for your great support and fast reply, it all works now.
:)
The topic has been locked.
Support Specialist
9 years 3 weeks ago #52339 by mel
Great, glad that got you going. As I said if you start to encounter any more weirdness if you change settings or upgrade K2 in the future, the template override for item.php would be the first place to check.

-Melissa
The topic has been locked.