Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Add a pinterest widget. Information can be found here:
Comment | File | Size | Author |
---|---|---|---|
#31 | service_links-1411366-6.x.patch | 6.09 KB | TheCrow |
#31 | service_links-1411366-7.x.patch | 5.89 KB | TheCrow |
#24 | service_links-1411366-6.x.patch | 5.9 KB | fabioloool |
#20 | service_links-1411366-6.x.patch | 5.06 KB | TheCrow |
#18 | service_links-1411366-6.x.patch | 4.87 KB | TheCrow |
Comments
Comment #1
vint CreditAttribution: vint commentedOh yes, please!
Comment #2
SandraL CreditAttribution: SandraL commented+1
Comment #3
funana CreditAttribution: funana commented+1
Comment #4
TheCrow CreditAttribution: TheCrow commenteduploaded it in the home page: http://servicelinks.altervista.org/
if someone would try it and give feedback is welcome...
Comment #5
theoracleprodigy CreditAttribution: theoracleprodigy commentedI have used this and it works okay. The biggest issue with Pinterest is that there is no great way to get the image from your nodes. I have this on a site that always has an image on a separate field. So I was able to code some php code into the node template which gets the image. I can't see this being a workable solution but if it helps someone else here is the code that is working for us.
-----------------
Which kind of goes hand in hand with another issue. Facebook never gets the right image to share and you can code it but it doesn't grab the image you tell it to use. So on the one hand you can code the images and maybe it works or the Facebook way which always has issues. Either way is not great.
Comment #6
sokrplare CreditAttribution: sokrplare commentedJust tried it out too using my wife's Pinterest account and it doesn't work on your blog because no image is associated with the "Pin It" button. As a result nothing is posted. It pops up and lets you login just fine - goes all the way through, but without an image it doesn't actually do anything when you submit the pin.
Comment #7
sokrplare CreditAttribution: sokrplare commentedBTW, I'll be around for another 4-5 hours so can test iterations if you'd like. I'll keep this thread handy. I'd much prefer using Service Links than hard-coding this.
Comment #8
sokrplare CreditAttribution: sokrplare commentedI'm looking at the code for the WordPress Pinterest Plugin and noticed that in js/pinterest-pin-it-button.js it calls https://assets.pinterest.com/js/pinmarklet.js instead of http://assets.pinterest.com/js/pinit.js (what you're calling, and indeed what the http://pinterest.com/about/goodies/ generator calls).
Haven't looked into the pinmarklet.js code in depth, but an initial perusal makes me wonder if it scans the page for images vs. pinit.js expects an image URL to be given to it. Thoughts?
Comment #9
sokrplare CreditAttribution: sokrplare commentedLooks like I was on the right track - these blogs confirm:
http://www.squarespaceplugins.com/add-pinterest-pin-it-share-button-in-s...
http://help.squarespace.com/customer/portal/articles/376251-adding-pinte...
Only down-side of using the pinmarklet.js code is it sounds like you lose the pin count bubble (bottom comments http://developers.squarespace.com/design-coding/post/1729891).
Comment #10
sokrplare CreditAttribution: sokrplare commentedHmmm...potential option to use pinit.js and grab first node image-field: http://stackoverflow.com/questions/6656595/how-to-get-the-first-image-fi...
Comment #11
sokrplare CreditAttribution: sokrplare commentedAny chance you could include a patch/code for Pinterest so I can start playing around with it?
Comment #12
sokrplare CreditAttribution: sokrplare commentedNevermind, just found out we're supposed to use Gigya. Plus going to put Pinterest underneath each image on the site instead of on the page, so that will avoid the problem entirely.
Comment #13
TheCrow CreditAttribution: TheCrow commentedthis is the widget module i am working on but for 7.x
Comment #14
roborn CreditAttribution: roborn commented@TheCrow looks ok, here.
The patch for TheCrow's work. We can backport this to 6.x once reviewed.
Comment #15
TheCrow CreditAttribution: TheCrow commentedfinally i got my pinterest account! seems there is a mistake with the description field, the right tag is <raw-encoded-teaser>, my mistake,
Concerning the picture i could implement a way to use a token to fill the media parameter...
Comment #16
TheCrow CreditAttribution: TheCrow commentedHere a patch to try
[Edit]
Add also the javascript included in the first package under the "js" folder
Comment #17
z.stolar CreditAttribution: z.stolar commentedLooking forward for a D6 backport. Let us know if/when help is needed.
Comment #18
TheCrow CreditAttribution: TheCrow commentedThe latest patch for both versions.
Comment #19
topdillon CreditAttribution: topdillon commentedI am getting errors on D6 patch. Do I need to put a token in the Media parameter? How do I choose?
warning: Illegal offset type in /home/demo/public_html/sites/all/modules/contrib/token/token.module on line 332.
warning: Illegal offset type in /home/demo/public_html/sites/all/modules/contrib/token/token.module on line 337.
warning: Illegal offset type in /home/demo/public_html/sites/all/modules/contrib/token/token.module on line 346.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/demo/public_html/sites/all/modules/contrib/token/token.module on line 346.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/demo/public_html/sites/all/modules/contrib/token/token.module on line 349.
warning: array_values() [function.array-values]: The argument should be an array in /home/demo/public_html/sites/all/modules/contrib/token/token.module on line 350.
warning: Invalid argument supplied for foreach() in /home/demo/public_html/sites/all/modules/contrib/token/token.module on line 413.
Comment #20
TheCrow CreditAttribution: TheCrow commentedThere is a mistake in the use of token_replace function for 6.x:
replace this:
with:
reworked patch attached!
Concerning the token to add, maybe this module could help you: http://drupal.org/project/token_field
otherwise just implement your custom token following the token documentation page
Comment #21
fabioloool CreditAttribution: fabioloool commentedGreat work but the 20# patch need some implementation (6.x.)
The button and the link are ok in my case, but when i click the button, the pupup won't post the pin ... maybe becouse in the code of the button there's not image or description?
By the way the url link seems ok but don't figure why the pinterest popup window don't let me complete the pinit process.
Comment #22
fabioloool CreditAttribution: fabioloool commented#21 tested and works great 4 me I putted the imagecache path in the media field builded with the Custom Token Module.
Thanks!
Comment #23
TheCrow CreditAttribution: TheCrow commented@fabioloool Thank you to remember us this: http://drupal.org/project/token_custom, i was aware of some helpful module to achieve our goal but i forgot their links!
Comment #24
fabioloool CreditAttribution: fabioloool commentedCustom token is wonderfull.
I just added the description field integrated with tokens too...
I'm new in pathc system.. hope it's ok!
Comment #25
z.stolar CreditAttribution: z.stolar commented@fabioloool, your patch at #24 fails. I didn't manage to understand why.
Comment #26
z.stolar CreditAttribution: z.stolar commentedComments on the patch at #20: There is no icon in the admin list and the widget is not shown, also for a lack of icon.
The admin icon can be arranged with adding an icon to the images folder. However, it seems as if the widget should come from Pinterest itself. Does it work for you?
Comment #27
TheCrow CreditAttribution: TheCrow commentedicon at #14 or #13, patch at #18 for D7 and #20 for D6, a working example is in the home page.
#24 have to be reworked a little.
Comment #28
fabioloool CreditAttribution: fabioloool commented#24 works for me ... is for drupal 6 .. you can see it here in action http://adoroletuefoto.it/contest/ritratto-di-persona-portrait-person/ice...
Comment #29
topdillon CreditAttribution: topdillon commented#20 leaves me without an image to pin. I used the filepath token. I also noticed the filepath used is for the original image, not the imagecache version.
Comment #30
topdillon CreditAttribution: topdillon commented#24 won't apply. I get error:
patch: **** malformed patch at line 62: + '#description' => t('Fill the description parameter with a token which will be evaluated by <a href=@url>Token</a> module.', array('@url' => 'http://www.drupal.org/project/token')),
Comment #31
TheCrow CreditAttribution: TheCrow commented#24 just add a configurable description tag with token... i reworked it a little and attached here.
concerning the image, check in the source page the link generated for the pinterest service it should have the parameter &media=full-path-to-your-image, if is not like that print here the result.
I didn't tried filefield token but fabioloool used http://drupal.org/project/token_custom successfull, and me i created a custom token just as example here: http://servicelinks.altervista.org/.
Comment #32
topdillon CreditAttribution: topdillon commented#31 works. I just had to add site-url and file-path tokens. Thanks.
Comment #33
mattwmc CreditAttribution: mattwmc commented>>>Which kind of goes hand in hand with another issue. Facebook never gets the right image to share and you can code it but it doesn't grab the image you tell it to use. So on the one hand you can code the images and maybe it works or the Facebook way which always has issues. Either way is not great.<<<<
Are you using the Open Graph Meta Tags module?
You can specify which image you want FB to use.
http://drupal.org/project/opengraph_meta
Comment #34
topdillon CreditAttribution: topdillon commented@mattwmc - I am not using the open graph meta tags module. It sure looks promising.
Comment #35
mattwmc CreditAttribution: mattwmc commentedHere is a code that allows the user to choose the image.
I hardcoded it to my pages through the page.tpl.
Is there a way to incorporate it here?
via: http://www.clickinmoms.com/blog/add-a-pinterest-pin-it-button-to-all-of-...
Comment #36
TheCrow CreditAttribution: TheCrow commentedCodes pushed in the repo.
@mattwmc i suggest to play with tokens instead.
Comment #38
addisj CreditAttribution: addisj commentedUsing the patch from #31 with service_links 7.x-2.x-dev, has the pinterest button disappeared for anyone else?
I previously used the patch from #14 and it worked fine except that the descriptions were broken.
If I turn off Javascript I see the pinterest link in the source:
<a target="_blank" rel="nofollow" title="Pin It" class="pin-it-button service-links-pinterest-button" href="http://pinterest.com/pin/create/button/?url=http%3A//sample.wild.com/shop/stitch-time&description=&media=%3Cpinterest-media%3E"><span class="element-invisible">Pinterest</span></a>
Once I enable Javascript, the link is removed (I believe when pinit.js is loaded). Also, even though I have added tokens for Description and Media, nothing is being appended to the URL. I see references to the Custom Token module, is this required?
Comment #39
BeaPower CreditAttribution: BeaPower commentedany updates, is this committed to dev?
Comment #40
TheCrow CreditAttribution: TheCrow commented#36 is the answer for both
Comment #41
BeaPower CreditAttribution: BeaPower commentedThanks, shows nicely!
Comment #42
zikaelismik CreditAttribution: zikaelismik commentedI just installed latest dev release but pin it button doesn't shows in my panel pages.
Every other service is working fine, and pinit.js gets loaded too. Just the pinit html part doesn't render at all.
Any clues?
Comment #43
BeaPower CreditAttribution: BeaPower commentedIt works for me in panels...
Comment #44
edulterado CreditAttribution: edulterado commentedI´m obtaining this Error message when trying to use service links as a field in Views and when I include Pinterest:
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7501 of /path/to/drupal/includes/common.inc).
There is no rendered content in the whole page when the error occurs. For avoiding this I just disable the Pinterest service (or avoid the use of tokens), and that made me think firstly that the problem was related to Pinterest (and more specifically, probably, with the token implementation, but I can´t provide further details on that). The error is not popping up in node teasers or full view, just only in Views fields.
I´m using:
drupal 7.14
service links 7.x-2.x-dev (latest version, with no patches related to Pinterest)
views 7.x-3.3
Comment #45
wzoom CreditAttribution: wzoom commentedQuick fix for error from #44:
Simply add code:
$node = node_load($node->nid);
at the beginning of function ws_pinterest_button_tags() in services/widget_services.module
Comment #46
kimadamson1 CreditAttribution: kimadamson1 commentedTrying hard to get the Pinterest button on my D6 product and blog nodes. Post #35 works, but I would rather use the .dev version with the token_custom fix instead. I know nothing about php, so I don't have the first clue about creating a custom token. Would love it if you shared your custom token code so us noobs can use it as a template. I've got the token_custom mod downloaded.
Thanks!
Comment #47
soncco CreditAttribution: soncco commentedThere is a module for pinterest http://drupal.org/project/pinit
Comment #48
LEKSHMY CreditAttribution: LEKSHMY commentedHow can we use pintrest username to login to my website???Pls help me!!!
Just like Fb connect or twitter oauth!!!
Comment #49
jenlampton@LEKSHMY you might try askng your question of the pinit module, service links is not the correct place to ask this question since it does not provide any kind of external authentication.
You'd also be better off opening a new issue asking your question specifically - not adding an unrelated comment on a completely different issue. If you open a new issue and ask a question in the wrong place then someone else can help you out and re-assign the issue to the correct module for you.
@TheCrow thank you so much for all your work on this module :)
The patch in #31 has whitespace errors for me (line 130) and appears not to be formed correctly (missing git's a/b directory compare stuffs.) Also, after I got the patch correctly applied, it looks like the option for enabling the pinterest widget is missing (although the pinterest link option is there, as well as the new settings form options for the pinterest widget).
I'm going to try to install the dev branch and see if things are any better over there.
*UPDATE* The dev branch works great, with the one exception that using existing tokens for image fields seem to make the Pinterest button not show up anymore. I ended up writing my own little token module that returns the URL of first image on the node, which the Pinterest widget seems to like. if anyone would like to use it you can grab it from github.
Comment #50
FranCarstens CreditAttribution: FranCarstens commentedSweet! @jenlamption, I'm trying to add pinterest as a general service, but a manner to call the first image is what I'm lacking. Is there a way in which I can use your token? For more information please have a look at the http://drupal.org/node/1664076
Appreciated. :D
Comment #51
jglynn CreditAttribution: jglynn commentedFor Drupal 7, I used the Custom Token Module and the following php code to define the token. This gives you a token that returns the url of the first image in a field, with the image style setting applied (main_listing_image, in this case).
Hope that helps!
Comment #52
waltercat CreditAttribution: waltercat commentedThis is a start, but I keep getting a broken image when I try this code. Am I supposed to change out some of the variables in the php code above to get to work? Does this only work for one node type and one field type?
Comment #53
RaulMuroc CreditAttribution: RaulMuroc commentedAre you sure this is fixed? I installed Service links and activated: General services + widget services and 'Pinterest Widget' does not appear at all while other services yes.
Comment #54
FranCarstens CreditAttribution: FranCarstens commentedThanks @jglynn for the help. I was able to create a custom token for the image field, but I have no idea to to implement its use. Once I have the token what do I do with it? Adding it to my widget just outputs the token name, not an actual image url leaving me with an "image not found". :(
Comment #55
Simon Georges CreditAttribution: Simon Georges commentedPlease use the -dev version of the module to have "Pinterest" widget available.
Comment #56
FranCarstens CreditAttribution: FranCarstens commentedIs there a way to convert the pinterest image token (or any token) to a "tag" like so it can be used in a general service?
May an option to create custom tags?
The reason I'm specifically interested in the general service as opposed to the widget is the widget does not allow one to override the icon. :( I already have a working "general" service, without an image, for Pinterest. http://drupal.org/node/1664076
Comment #57
TheCrow CreditAttribution: TheCrow commentedthe 'preset' field and related function is what you need.
Comment #58
waltercat CreditAttribution: waltercat commentedI think one of the issues people are having (myself included) is what the media parameter field is and how to use it. I understand tokens, but I am not sure how to integrate them in this case, since my images are used in a variety of contexts with different paths to the image. Here is a link to my page on my dev site and you can see the image comes up broken:
http://dev.bkwinery.com/fall-2012-harvest-update/2411
Any help would be greatly appreciated.
Also does this only pick one image or does it work when there are multiple images on the page?
Comment #59
TheCrow CreditAttribution: TheCrow commentedmaybe some news about multiple images: http://business.pinterest.com/widget-builder/#do_pin_it_button
the button look accept a new parameter... any image... have to see it better.
Comment #60
damon hart CreditAttribution: damon hart commentedwaltercat, I visited your site via the link provided and it seems you now have a working Pintrest button that appears to be separate from the service links Pintrest button that still doesn't work. If you can please explain how you did this I would be very grateful.
Comment #61
waltercat CreditAttribution: waltercat commenteddamonbha, I broke down just used the pinterest code on their site: http://business.pinterest.com/widget-builder/#do_pin_it_button
It isn't what I really want to do as it only works for about 50% of my image cases. What I really want to do is figure out a way to pin my images from a lightbox window. But there seems to be very little interest on making pinterest work with drupal, I've spent a lot of time searching around and haven't found much. I would personally love something that works like this where you simply hover over the image and you can pin it: http://www.stylemepretty.com/2013/04/05/costa-rica-wedding-from-a-brit-a...
From a marketing and SEO standpoint, being able to allow people to simply pin images is game changing for sites like mine.
Comment #62
deggertsen CreditAttribution: deggertsen commentedWaltercat, it seems like you could do what you want to do by simply creating a field-name-[field_name].tpl.php file in your theme. Then you could use the $items variable to pull the uri for the image. Use some simple hover css and there ya go... Here's a quick example of what I think might work, though I haven't tried it myself.
I'm not sure if the $node variable is available in field.tpl.php files, so if it's not you would have to do something else to get the page url to work. Use this as a reference and let me know if you get it working (http://api.drupal.org/api/drupal/modules%21field%21theme%21field.tpl.php/7). I may do this on one of my sites one of these days, but I hadn't even thought of it until you posted here. Might be a good idea to make this a separate issue as a feature request with a UI admin checkbox to enable a hover pin it image over any images.
Comment #63
Andy_D CreditAttribution: Andy_D commented@32 - Anychance you could document what you put in these fields as 1/2 day of frustration hasn't gotten me very far!?
Thanks in advance
Comment #64
darrell_ulm CreditAttribution: darrell_ulm commentedThe pinterest button does not seem to be working in general yet without extra code hacked in, correct? Working on a D6 version, or perhaps the backports are not added yet?Disregard, I got it, it was a simple soln. thank you!