I've been trying to find a way to make pages sharable in a friendly-way. That is, facebook, digg and other websites rely on a few meta tags to work, specifically:
<meta name="title" content="title" />
<meta name="description" content="description " />
<link rel="image_src" href="thumbnail_image" / >
I didn't find any module providing this possibility, and I couldn't figure out where exactly should I work on. After some research:
Share
http://developers.facebook.com/docs/share
http://drupal.org/node/363679#comment-3082516
http://drupal.org/node/223440
OpenGraph
http://drupal.org/node/803512
http://drupal.org/node/804112
http://drupal.org/files/issues/nodewords_og.zip
http://lab.publicreative.com/2010/06/open-graph-drupal-module/
My idea was to give a simple interface, that uses tokens, to specify which elements should go in those fields, depending on the node type, so I came across "nodewords_nodetype", which seems to provide all the necessary means to do just that. I tried extending nodewords_nodetype_nodewords_tags_alter() using $output_tags, but I couldn't make it work (I think I'm missing something here...). I ended up using drupal_set_html_head(), which I know is not elegant and not the best way, though it works.
I'm uploading the patch, if you could take a look at it and tell me what's the correct way instead maybe we could incorporate it into the main module.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| nodewords_nodetype.patch | 2.87 KB | 4v4l0n42 |
Comments
Comment #1
SimonV commentedHas anyone reviewed this? Any way it will make it's way in to the main module? I'm testing now and will post my feedback.
Comment #2
carlo-nois3lab commentedAnyone?
Comment #3
dcoder commentedyep, anyone? this can be replicated using only nodewords?
Comment #4
hanoiiI guess the proper way to do this is as a plugin for the nodewords module, and then, maybe extending this module to support it. The way suggested by this patch is really specific to this use and it can be just done on a completely separate helper module, the only thing you are using by this module is the settings page which is not a real reason to include such a functionality.
Comment #5
hanoiiComment #6
hanoiiI am rather closing this issue for now. The purpose of this module was to define nodewords meta tags defaults on a per content type basis, not any other meta tag so unless nodewords is extended to include these tags or they are provided on a separate module I don't think I will be including this feature for now.
Comment #7
kalis1Just a note to say that the new 6.x-1.13 version of the nodewords module supports now the Facebook Open Graph Protocol tags, see http://drupal.org/node/1382286
Comment #8
radoya commentedBut it seams that we are not able to set open graph metatags as default for content type, not even with 6.x-1.13 version of the nodewords.. Did I miss something?