Reading a bit more about the new menu system I think following piece of code shows the probably desired future direction of this module:

// $Id$

/**
 * Implementation of hook_init().
 */
function nodewords_init() {
  $item = menu_get_item();
  if ($item['access']) {
    switch ($item['path']) {
      case 'node/%':
        // This adds the tags for node pages (note the support for tokens).
        $tags = array(
          'DC.title' => '[title] - [site-name]',
          'description' => '[body]', //TODO: [body] is not a token
        );

        if ($node = menu_get_object('node', 1)) {
          $tags = token_replace($tags, 'node', $node);
          foreach ($tags as $key => $value) {
            drupal_set_html_head('<meta name="'. $key .'" content="'. $value .'" />');
          }
        }
        break;

      // A similar portion would appear for other special
      // pages we handle, eg panels, views, taxonomy, ...

      default:
        // Here we would add the tags that appear on every
        // page.
    }
  }
  else {
    // Here we could add tags that people want to see on
    // "Access denied" pages or "Page not found" pages.
    drupal_set_html_head('<meta name="robots" content="noarchive,nofollow,nocache,noindex" />');
  }
}

This gets rid of the nodewords_get_type_and_ids() because the menu system more or less gives that for free.

This is just proof-of-concept. I'll need to investigate whether the other special pages we support can be handled this way too. Panels doesn't have a D6 branch yet and at first glance, views is not as easy as views/%view_id.

Still, I think we could have winner here...

Comments

Robrecht Jacques’s picture

Version: 6.x-1.x-dev »
Status: Active » Postponed
avpaderno’s picture

hook_init() is only called for not cached pages; this means the module would not set the meta tags for already cached pages (which is not desired).

avpaderno’s picture

Assigned: Robrecht Jacques » Unassigned
Status: Postponed » Closed (won't fix)

Branch 6.x-2 has never been supported, and it is not anymore developed.