Hi you all,

I've read http://www.lullabot.com/articles/great-pretender-making-your-data-act-field where Jeff Eaton creates a module for Drupal 6 to relocate the content links (the ones for print, send email, flag, and many other) with the rest of CCK fields. The result is wonderful and the code really short, and now I'm trying to do the same for Drupal 7, but my knowledge on the new CCK api is short.

I've managed to be able to see a handler for the links on the fields display management page with that function:

<?php
function display_mover_field_extra_fields() {
  $extra = array();
   
  foreach (node_type_get_types() as $type) {
    if ($type->has_title) {
      $extra['node'][$type->type] = array(
        'display' => array(
          'links' => array(
            'label' => t('Node links'),
            'description' => t('Links displayed when a node is viewed.'),
            'weight' => 100,
          ),
        ),
      );
    }
  }
  return $extra;
}
?>

The links are relocated and save a new weight (a new order). That's very interesting because even the node title could be relocated the same way.

Now the point is being able to display the relocated the links on the content area when viewing the node with something like:

<?php
/**
 * Implementation of hook_nodeapi().
 */
function display_mover_node_view($node, $view_mode, $langcode) {
  $links = array();

  $node->content['links']['#weight'] = -100;
}
?>

I've tried many, many variations, but finally I have not being capable to find the proper way to do it.

Any help? :-)