| Versionen | |
|---|---|
| drupal6 – drupal7 | hook_link($type, $object, $teaser = FALSE) |
Define internal Drupal links.
This hook enables modules to add links to many parts of Drupal. Links may be added in the navigation block, for example.
The returned array should be a keyed array of link entries. Each link can be in one of two formats.
The first format will use the l() function to render the link:
The second format can be used for non-links. Leaving out the href index will select this format:
$type An identifier declaring what kind of link is being requested. Possible values:
$object A comment object.
$teaser A 0/1 flag depending on whether the node is displayed with its teaser or its full form.
An array of the requested links.
modules/
<?php
function hook_link($type, $object, $teaser = FALSE) {
$links = array();
if ($type == 'comment') {
$links = comment_links($object, FALSE);
return $links;
}
return $links;
}
?>
Kommentare
Kommentar hinzufügen