Hook link goes away in drupal 7, so links are loaded in hook_node_view()
http://drupal.org/update/modules/6/7#node_links

function blog_node_view($node, $view_mode) {
  if ($node->type == 'blog') {
    if (arg(0) != 'blog' || arg(1) != $node->uid) {
      $links['blog_usernames_blog'] = array(
        // Unrelated to the change where links are added, Drupal 7 also adds a
        // format_username() function.
        'title' => t("!username's blog", array('!username' => format_username($node))),
        'href' => "blog/$node->uid",
        'attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($node)))),
      );
      $node->content['links']['blog'] = array(
        '#theme' => 'links',
        '#links' => $links,
        '#attributes' => array('class' => array('links', 'inline')),
      );
    }
  }
}

Comments

BenK’s picture

Subscribing... any word on a D7 port?

iRex’s picture

subscribe

skizzo’s picture

subscribing

henrijs.seso’s picture

Title: Drupal 7 support - no more hook_link » Port Custom links to Drupal 7
Category: feature » task
StatusFileSize
new45.87 KB

Hello,

Here is rewrite of module for D7. It is based on Ctools exportables, so all Features and UI goodies available. Currently links are rendered on Panels panes, so Panels is a must, another module could supply custom blocks. Supports Tokens. Will be available as Experimental Project as soon as I figure out git ;) Comments welcome.

henrijs.seso’s picture

StatusFileSize
new46.09 KB

Some bug fixes, schema did not change. Todo: generic block support, render code optimization. Will add this month.

Rory’s picture

Status: Active » Needs review
henrijs.seso’s picture

Status: Needs review » Active
StatusFileSize
new41.33 KB

There is no patch, nothing to review. Attached is latest version. I keep using it sometimes and improve a little.

Gerald Mengisen’s picture

The Rules Link module might be an alternative for Custom Links in D7.

henrijs.seso’s picture

I have created sandbox out of code I attached above. Check it out... http://drupal.org/sandbox/mansspams/1989992