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')),
);
}
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | link_pane.zip | 41.33 KB | henrijs.seso |
| #5 | link_pane.zip | 46.09 KB | henrijs.seso |
| #4 | link_pane.zip | 45.87 KB | henrijs.seso |
Comments
Comment #1
BenK commentedSubscribing... any word on a D7 port?
Comment #2
iRex commentedsubscribe
Comment #3
skizzo commentedsubscribing
Comment #4
henrijs.seso commentedHello,
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.
Comment #5
henrijs.seso commentedSome bug fixes, schema did not change. Todo: generic block support, render code optimization. Will add this month.
Comment #6
Rory commentedComment #7
henrijs.seso commentedThere is no patch, nothing to review. Attached is latest version. I keep using it sometimes and improve a little.
Comment #8
Gerald Mengisen commentedThe Rules Link module might be an alternative for Custom Links in D7.
Comment #9
henrijs.seso commentedI have created sandbox out of code I attached above. Check it out... http://drupal.org/sandbox/mansspams/1989992