Last updated 9 December 2010. Created on 12 November 2010.
Edited by stacywray, Dave Cohen, aangel. Log in to edit this page.

These instructions apply to nodewords 6.x-1.11 and possibly later; step 3 may no longer be needed in later versions.
The description of Open Graph tags is located at http://developers.facebook.com/docs/opengraph.
You can tag your pages with one of the types listed here: http://developers.facebook.com/docs/opengraph#types
Sample types are "bar," "movie," "article," and "blog" and "website."

  1. Download the Nodewords module from http://drupal.org/project/nodewords and move it into your module directory. Turn it on via /admin/build/modules.
  2. From the issue comment http://drupal.org/node/836282#comment-3460830, download nodewords_opengraph.zip. Expand the archive, move it into your module directory and turn on the module; it will be located in the Meta Tags fieldset.
  3. Locate the nodewords module directory, move the patch into it and apply the patch to nodewords.module (attached). See http://drupal.org/patch/apply for instructions.
  4. Configure the roles you would like to be able to edit meta tags at /admin/user/permissions.
  5. At /admin/content/nodewords/settings, check the meta tags you would like made available on the content type edit pages. User 1 (the administrator user) is able to see all of them no matter what you set here.

    Your choices currently are:

    • Facebook Admins
    • Facebook App ID
    • Facebook Page ID
    • Open Group Description
    • Open Group Image
    • Open Group Site Name
    • Open Group Title
    • Open Group Type
    • Open Group URL
  6. On this page also set the meta tags you would like to print on your pages. Meta tags you set on nodes will not appear unless you check the fields here.
  7. Add the following html tag attributes in the top of your page.tpl.php file (and any page.tpl.php derivatives) located in your theme directory:
    xmlns:og="http://opengraphprotocol.org/schema/"

    For example:

    <html xmlns:og="http://opengraphprotocol.org/schema/"
      xmlns:fb="http://www.facebook.com/2008/fbml"
      xmlns="http://www.w3.org/1999/xhtml"
      lang="<?php print $language->language; ?>" xml:lang="<?php print $language->language; ?>">
    
  8. Testing

    With Nodewords OpenGraph you can tag individual pieces of content i.e. stories, pages and other content accessible via a unique URL. If you are going to edit many tags set the default tags at /admin/content/nodewords/meta-tags.

    In this example we are going to create a sample page, apply Open Graph tags, "Like" it (i.e. click "Like" on the page) and see it appear on your wall. Types other than "article" should also appear in your Interests section on your Info tab.

    1. Create a page node via /node/add/page. For the title use "Test Page."
    2. In the body of the node, add a Like tag. Make sure your input format is set to Filtered Input or similar or Drupal may strip it before rendering the page. Use this:
    3. Expand the Meta Tags fieldset and set the tags similar to those below. Replace with your domain.
      Open Graph Title: Test Page
      Open Graph Type: Article
      Open Graph URL: http://www.youdomain.com/yoururl
      Open Graph Site Name: Your Domain
      Facebook App ID: yourappid
      Open Graph Description: This is a test page.

      Note: You don't need to provide both the Facebook Admins and the Facebook App ID; one or the other is fine (as is both).

      If you don't supply an Open Graph Title and Open Graph URL, Facebook will determine it for you based on the "Like" request. Thus, you may be able to specify just the unique description for each node when entering content especially if you provide defaults for the other fields.

    4. Save your changes.
    5. View the source HTML of that node. You should see your new meta tags. Note that the values in 'content' below are just filler; you should use real values.






    6. View the page and click the "Like" button. It will update with the number of "likes" for that page so far. If you get an error, click on the red 'error' link and view it. If you are testing with a fake URL, a common error is "Page cannot be reached."
    7. View your Facebook Wall. You will see "YourName likes Your Domain. · Like · Comment" and the page will be in the Facebook graph.
AttachmentSize
nodewordsforog.diff838 bytes

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.