HJ Social Bookmarks
Back to this add-on's main page
View Other Add-ons From Berry Timmermans
Adding Pinterest to the list
General
|
Chris Arnold
|
| Posted: 27 January 2012 10:40 PM |
|
|
|
|
I’m tackling adding Pinterest to this addon and am 75% there. Pinterest requires both the URL (typical) and a specific image link (not typical) to be “pinned” into a user’s account.
What might be the best way to go about defining an $imageLink variable? It’s not as smart as Facebook in that it lets the user choose from all images on the page. That would’ve been too easy.
Thanks!
|
|
|
|
|
Chris Arnold
|
| Posted: 30 January 2012 04:20 PM |
# 1
|
|
|
|
With some help from the developer, here is the solution:
(1) Open the plugin file and create a variable around line 64:
$image = $this->EE->TMPL->fetch_param(‘image’);
(2) Then append the variable to the new Pinterest url, e.g.:
http://pinterest.com/pin/create/button/?url=’ . $permalink . ‘&media=’ . $image
(3) Then in the template for your page, add the new variable to the tag. In my case a matrix row:
{exp:hj_social_bookmarks sites=“Pinterest” entry_id=”{entry_id}” image=”{photos limit=“1”}{image}{/photos}”}
You’ll obviously also need to create your own Pinterest image, etc following suite from the other HJ Bookmarks. Thanks to Berry!
|
|
|
|
|
|