Pinterest button on K2 items?

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
Wed Apr 02, 2014 5:07 pm
Reply with quote
Report this post
Hey. Is there a way to show Pinterest PIN button on K2 articles like in Joomla native articles?

I want to show all of these buttons:
http://www.manitas.si/newsite/about/75-manitas

on K2 item:
http://www.manitas.si/newsite/component ... 14-manitas
User avatar
Senior Boarder

GK User
Thu Apr 03, 2014 9:01 pm
Reply with quote
Report this post
K2 don't have this kind of feature and there is no copy/paste code that I can provide you here. Probably you should ask on K2 support forum for more details about layout modifications and adding new features to this 3rd party extension.
User avatar
Platinum Boarder

GK User
Fri Apr 04, 2014 8:37 am
Reply with quote
Report this post
thank you for reply! will try some other 3rd party extension.
User avatar
Senior Boarder

GK User
Mon Apr 07, 2014 10:36 am
Reply with quote
Report this post
You should look for kind of K2 plugin because you can't display module inside article content so if you want to keep the same position plugin is the only solution.
User avatar
Platinum Boarder

GK User
Mon Apr 07, 2014 11:41 am
Reply with quote
Report this post
hi, thank you for your help.

Afterwards, I changed the php code into item.php of K2 in templates and showed what I wanted:
http://www.manitas.si/newsite/about/ite ... 0KAqq2SxGA
User avatar
Senior Boarder

GK User
Wed Apr 09, 2014 11:13 pm
Reply with quote
Report this post
You can share here file and added code, it will be helpful for other K2 users who want to extend this social button functionality.
User avatar
Platinum Boarder

GK User
Thu Apr 17, 2014 12:14 pm
Reply with quote
Report this post
yes, right.

in this file: template/gk_storebox/html/com_k2/templates/default/item.php

I deleted this:
<?php if($params->get('itemTwitterButton',1) || $params->get('itemFacebookButton',1) || $params->get('itemGooglePlusOneButton',1)): ?>

and replaced everything that was in between:
<div class="itemSocialSharing"> </div>

with this:
Code: Select all
                           <div class="itemSocialSharing">
                                    
                                    <!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a style="margin-top: -4px;" class="addthis_button_facebook_send"></a>
<a style="margin-left: 10px;" class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit" pi:pinit:layout="horizontal"></a>
<a style="margin-top: -3px;" class="addthis_button_google_plusone" g:plusone:size="wide"></a>
<a style="margin-left: -20px;margin-top:1px;" class="addthis_button_linkedin_counter"></a>
<a style="margin-left: 10px;" class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra- <!--GET YOUR CODE ON ADDTHIS.COM--> "></script>
<!-- AddThis Button END -->
                                    
                           </div>
User avatar
Senior Boarder

GK User
Thu Apr 17, 2014 12:16 pm
Reply with quote
Report this post
I've attached item.php - but forum doesn't seemed to upload it?

item.php.zip
User avatar
Senior Boarder

GK User
Thu Apr 17, 2014 4:02 pm
Reply with quote
Report this post
I see your attachment so it looks like all is fine.
User avatar
Platinum Boarder

GK User
Thu Apr 17, 2014 4:36 pm
Reply with quote
Report this post
yeah, i figured after that zip as attachment is working :)
User avatar
Senior Boarder

GK User
Tue Apr 22, 2014 9:34 am
Reply with quote
Report this post
I think that the problem may be related with your script location - probably it should be included in head area so you have to use Joomla API code or modify template header area. Did you try to make a custom HTML module and place there the button code + script to check whether it is working or not? This will give us sure where there is a problem - in your code or with the JS from pinterest.
User avatar
Platinum Boarder

GK User
Wed Jun 18, 2014 8:07 am
Reply with quote
Report this post
hmm, this worked before, now I am not sure why it stopped?

I have no clue how to add this code as Joomla API code, never learned about this, yet.

where I can find the header where i could import this scripts inside:

Code: Select all
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra- <!--GET YOUR CODE ON ADDTHIS.COM--> "></script>
User avatar
Senior Boarder

GK User
Wed Jun 18, 2014 8:17 am
Reply with quote
Report this post
ahh, i figure it works actually the way I've posted in April - I was now testing on developing site and refreshing live site :)

However, I think my item.php from K2 tools was only overwritten by some update, as I've put back the code now it works with all the button:

http://www.manitas.si/blog/news/item/225-new-arrivals

so is this way ok, or I should figure some new trick on how to add pinterest and other share buttons?
User avatar
Senior Boarder

GK User
Wed Jun 18, 2014 7:43 pm
Reply with quote
Report this post
The HEAD section of template is located in layouts/default.php file and there you can paste your code. This is K2 view you can also try to test this with Beez template but I suspect that result will be the same. It looks like the script is not loaded properly.
User avatar
Platinum Boarder

GK User
Thu Jun 19, 2014 6:29 pm
Reply with quote
Report this post
I moved it to header and it works.

I left inside this comment instead of tracking code :)
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra- <!--GET YOUR CODE ON ADDTHIS.COM--> "></script>
User avatar
Senior Boarder

GK User
Sat Jun 21, 2014 9:43 pm
Reply with quote
Report this post
Yes, in layouts/blocks/head.php you have content of HEAD area but HEADER opening/closing tag is available in default.php where the same code should work.
User avatar
Platinum Boarder


cron