Page 1 of 1

Adding Pinterest Pin-it button to a Joomla Site

Posted: Mon Jan 09, 2012 11:02 pm
by sd12013
Since each page is dynamically created for a Joomla site built into a single index.php framework, and the pin-it code for each page requires a specific image url, is there even a generic string variable you can dictate in a static pin-it script that will dynamically feed the pages' image urls into the button's code?

It seems like you'd need some new fields added to the Article editor via a plugin to specify the urls of the images that could be pinned along with their respective descriptions. Or is there another way?

Pinterest seems to be all the rage these days. Does anyone know of a solution? I hoping there's something simple I'm just overlooking.

You could dynamically create the url for the button script something like this, but I don't have a clue what you would put for the [image.jpg] in the body script:

head:

Code: Select all

<script type="text/javascript">
(function() {
    window.PinIt = window.PinIt || { loaded:false };
    if (window.PinIt.loaded) return;
    window.PinIt.loaded = true;
    function async_load(){
        var s = document.createElement("script");
        s.type = "text/javascript";
        s.async = true;
        s.src = "http://assets.pinterest.com/js/pinit.js";
        var x = document.getElementsByTagName("script")[0];
        x.parentNode.insertBefore(s, x);
    }
    if (window.attachEvent)
        window.attachEvent("onload", async_load);
    else
        window.addEventListener("load", async_load, false);
})();
</script>
body:

Code: Select all

<a href="http://pinterest.com/pin/create/button/?url=<?php echo $live_site; ?>&media=[image.jpg]" class="pin-it-button" count-layout="horizontal">Pin It</a>
edit: I just found that WordPress has something similar to what I was imagining"
http://flauntyoursite.com/pin-it-on-pinterest/
Could something like this be developed for Joomla?

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Thu Jan 12, 2012 7:09 pm
by chrisjclay
I'm sure it won't be too long before someone comes up with something similar... I may give it a try myself later this week, though I'm most interested in having it incorporated into my EasyBlog posts (I just posted a request in their discussion forum.)

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Thu Feb 23, 2012 8:35 pm
by karendanaher
I found this module to add "follow us on pinterst" to your site
http://inceptdesign.com/joomla

Hope this helps - I like it I just would like to get rid of where it reads "web design" on the button

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Fri Feb 24, 2012 10:35 am
by tamnl
@Karen: yeah, I know it but it's for Joomla 1.6 :(
I want to know about this extensions too. Can you give some more recommendations?

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Fri Feb 24, 2012 9:57 pm
by chrisjclay
It should also work on Joomla 1.7 and 2.5 sites. However, it only creates a "follow me on pinterest" button. I'm hoping for a plugin that will add a "pin it" button to articles and K2 items, though at least EasyBlog 3.5 will have this feature. It should be coming out soon.

Chris

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Sun Feb 26, 2012 2:36 pm
by julieo
I am looing for a pin it button as well.

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Sun Mar 04, 2012 10:08 am
by dattard
Hi guys and girls,

I scripted a number of modules and plugins for Pin It this week, it would be great if you could test and give me some feedback on these.

1. Simple Pin It module - just creates a Pin It button in a module
2. Pin It Module - allows you to create Pin It button, Follow me on Pinterest, or both.
3. Pin It plugin - replaces {pinit} text with a Pin It button

All can be found on my website linked below.

Would love it if you could install and give them all a test run.

Thanks in advance.

David

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Sun Mar 04, 2012 5:11 pm
by dattard
Oh and by the way, these are for 2.5. Did not notice the message was in the 1.5 forums!

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Tue Apr 17, 2012 1:10 pm
by washirv
Hi All

I've just added a dynamic Pin It button to the product page on my store. I'm working on Joomla! 1.5.23 and Virtuemart 1.1.9. To have the url and full image path dynamically passed on to Pinterest, I had to add their variables to the template. This is done in /administrator/components/com_virtuemart/html/shop.product_details.php. You add around line 458:

Code: Select all

$self_url = $sess->url($_SERVER['PHP_SELF'] . "?page=shop.product_details&product_id=$product_id");
$self_url .= '&flypage='.$ps_product->get_flypage($product_id).'&pop='.$pop;
$tpl->set( "MY_url", $self_url );
$tpl->set( "MY_thumb", $product_thumb_image );
$thumb_imgurl = JURI::base() . "components/com_virtuemart/shop_image/product/" . $product_thumb_image;
$tpl->set( "MY_thumb_url", $thumb_imgurl);
This adds the full page URL and the thumbnail URL to the template for later use.

To pull these parameters and place the actual button: /components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php . Add around line 67 (or wherever you want the button) the code from the Pinterest site, dynamically changing the url, image and description:

Code: Select all

<a href="http://pinterest.com/pin/create/button/?url=<?PHP echo "http://www.YOUR_DOMAIN_NAME.com/".$MY_url ?>&media=<?PHP echo $MY_thumb_url ?>&description=<?PHP echo $product_name ?>" class="pin-it-button" count-layout="none"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
It works for me and looks good in Pinterest.

One issue is that clicking the picture in Pinterest doesn't lead to the product, only to the site. I think the bug is ok their side, since the code passes the correct url, and I also saw this phenomena on other Pinterest posts (not VM).

Another curious thing is that if you add the small <script> they ask for, it completely undoes everything you do on the button. I don't know why this happens, but I didn't add it and it works fine.

Good luck everyone.

Yakir.

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Tue Apr 17, 2012 1:38 pm
by rlmacalintal
wow..pin button on joomla site will be a gread add-ons. i'll try it on my site

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Wed Apr 25, 2012 7:22 am
by SterlingOne
Oh my god, thank you! I can't believe I just said OMG but OMG! What a great snippet of code...

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Fri May 11, 2012 7:53 am
by saurabhshyara
Hey guys want to share something with you on this pinterest module on Joomla site. I tried some Pinterest Joomla addons and code, but none of them worked or picked the image automatically from the Joomla pages. Got a link from a friend and tried them and damn, they worked SUPERB!!! I can tell, Fancy Bookmarks Plugin is the best out of them. It even lets you choose the image, which you want to pin. You can check out these guys: http://www.qubesys.com/top-pinterest-ex ... or-joomla/

Hope it helps...

Re: Adding Pinterest Pin-it button to a Joomla Site

Posted: Sun May 20, 2012 9:23 pm
by munjin
thanks all for this helpful discussion.