Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently this module has basic support for Open Graph meta tags (through fb_social_like sub module). One of the missing meta tags is og:image.
While this can be done it's not straightforward and also there is a question whether the Open Graph should be supported by this project or as a separate one (http://drupal.org/project/opengraph_meta, http://drupal.org/project/open_graph ). If another modules is used, uncheck "Output the facebook opengraph tags for the above content types" settings at admin/settings/fb/social/like.
Comment | File | Size | Author |
---|---|---|---|
#13 | linter.zip | 1.48 KB | HLopes |
#11 | linter.zip | 1.49 KB | HLopes |
Comments
Comment #1
CobraMP CreditAttribution: CobraMP commentedthis would be great with the option to flip through a few found images to select the one you actually want posted
Comment #2
HLopes CreditAttribution: HLopes commentedAfter placing the meta tags, if your button isn't sending the proper image, try to put the url in here:
http://developers.facebook.com/tools/lint
After that, the button will display and send the proper image to facebook.
I have no clue why, but it works. I've added a cron_hook to the module that iterates through nodes and performs a request to that url, and now all my buttons are working everywhere (inside node, in views, teasers....).
Just FYI...
Comment #3
Sanka007 CreditAttribution: Sanka007 commentedI placed the meta tags and put the url in http://developers.facebook.com/tools/lint, and now the proper image is sent to facebook, but I don't know how to add the cron hook to the module.
Any help please?
Comment #4
HLopes CreditAttribution: HLopes commentedThis is the source code to add to "fb_social_like.module" file .
But before you use it you need to create a new table called "linted" with a int field called "nid" on your database.
Also, this is a workaround, and will take forever if your site has a lot of nodes, as it'll only process 60 nodes at a time.
Comment #5
Sanka007 CreditAttribution: Sanka007 commentedGreat, it works! Thanks for the help, really appreciate it.
Comment #6
HLopes CreditAttribution: HLopes commentedJust some optimizations....
Comment #7
madany CreditAttribution: madany commentedIt gives the warning:
user warning: Table 'drupalstore.linted' doesn't exist query: SELECT * FROM node WHERE nid NOT IN(SELECT nid FROM linted) AND status = 1 AND type IN('article','blog','faq','page','story','stores','products') LIMIT 0,60 in /public_html/sites/all/modules/fb_social/modules/fb_social_like/fb_social_like.module on line 223.
Comment #8
HLopes CreditAttribution: HLopes commentedComment #9
Dubber Dan CreditAttribution: Dubber Dan commentedThis looks really useful HLopes will it make it in to the next version of the module?
Comment #10
HLopes CreditAttribution: HLopes commentedI don't know, you should ask ferdi (the module maintainer).
It's not an essential function, though... The button should work without being linted. This is just a quick fix i've used in one of my websites.
For now, what i can do is pack this up in a standalone module to avoid the need to mess up with the database.
Comment #11
HLopes CreditAttribution: HLopes commentedSomething like this will do it...
If you use this, you won't need to mess with the database.
Just enable the module, it'll do his thingy whenever cron is ran.
If you have already applied the functions in the comments above, you can still use the module, but it'll throw an error when enabling, having the database table already created.
Remember: do not test on production sites!
Comment #12
emmry CreditAttribution: emmry commentedHLopes, thanks for your module! Unfortunately I have some issues with it.
First of all, there is a typo stating the name of the table in the linter.module: in two places it says "linted" where should say "linter". When cron is run this will cause an error saying table not found if not corrected.
With that corrected it seems to work fine - Facebook finds the correct images now for the nodes I've tried, however nothing is saved in the "linter" table. Haven't been able to figure out why. Since no recored of what has been "linted" is saved, perhaps all the nodes will be sent to Facebook every time cron is run?
Comment #13
HLopes CreditAttribution: HLopes commentedHi there,
you're correct, there's a typo. And the reason it doesn't add anything to the database has to do with an modification i've made to the code above.
The version in this comment should fix all that.
And that's why you always should test in a test server :D
Thanks for the feedback!
Comment #14
emmry CreditAttribution: emmry commentedGreat, thanks for the fast response!
Strange that the images works better when the pages have been checked by that Facebook linter though...
I mean it's sole purpose is to check for valid code right?! :-)
Comment #15
venusrising CreditAttribution: venusrising commentedWondering if anyone has made any headway getting this to work ? Not too sure if running something through facebook on a large site would be taxing to the server.
Comment #16
Summit CreditAttribution: Summit commentedSubscribing, coming from http://drupal.org/node/1012112.
Greetings, Martijn
Comment #17
venusrising CreditAttribution: venusrising commentedThis issue needs some serious help as an image is vital to the social graph.
Comment #18
HLopes CreditAttribution: HLopes commentedNot too sure if running something through facebook on a large site would be taxing to the server.
No, every cron run it will send 60 requests to Facebook's Linter Tool. It's like 60 people clicked on an external link on your webpage. Having all the content linted can take a while, though, depending on how often you run cron. The main concern on performance is the use of drupal_lookup_path function, as i've read somewhere that it is db intensive.
If you wish to increase the number of linted nodes per cron run edit the module and change the query.
Cheers
Comment #19
venusrising CreditAttribution: venusrising commentedIt seems to be there should be a better way than taxing the server to run it through linter. Why not a node field that can be designated as OG image by default. So, if you have a CCK content type then you could say okay this field will be the OG image as a default so you do not have to do it manually.
Comment #20
WashingtonIsBroke CreditAttribution: WashingtonIsBroke commentedI spent an hour trying to get this to work... before, I was getting a choice of 4 images that were in my right column, not any image that was in my blog post. Once I followed the instructions, I got NO images showing. The lint link does show the proper image however. Anywho.. after an hour, I decided to try another blog enter and guess what? IT WORKS! lol
www.WashingtonIsBroke.com
Comment #21
WashingtonIsBroke CreditAttribution: WashingtonIsBroke commentedUpdate: the correct image only shows up the first time you click on Share.
Note, the link (http://drupal.org/project/open_graph) in the opening takes you to the page and says..
Maintenance status: Abandoned
Development status: Obsolete
Is this something I need?
Comment #22
WashingtonIsBroke CreditAttribution: WashingtonIsBroke commentedUpdate: Image issue appears to be an issue with IE9. It's working fine with Chrome.