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!

CommentFileSizeAuthor
nodewords_nodetype.patch2.87 KB4v4l0n42

Comments

SimonV’s picture

Has 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.

carlo-nois3lab’s picture

Anyone?

dcoder’s picture

yep, anyone? this can be replicated using only nodewords?

hanoii’s picture

Status: Active » Needs work

I 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.

hanoii’s picture

Version: 6.x-1.7 » 6.x-1.x-dev
Assigned: 4v4l0n42 » Unassigned
hanoii’s picture

Status: Needs work » Closed (works as designed)

I 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.

kalis1’s picture

Issue tags: +facebook

Just 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

radoya’s picture

But 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?