It returns a warning: Invalid argument supplied for foreach() in /DRUPAL_PATH/themes/MY_THEME/links.tpl.php on line 12.
links.tpl.php:
/**
* to change the delimiter, just modify the $delimiter value
* Add in other fixed links to the link array by adding something like
* $links[] = l('link text', 'link path');
*
*/
$delimiter = " | ";
$link_count = count($links);
$current = 1;
foreach ( $links as $lnk ) {
($lnk['href']) ? print(l($lnk['title'], $lnk['href'], $lnk['attributes'])) : print(t($lnk['title']));
// Only print the delimiter if not the last link
if ( $current < $link_count ) {
print $delimiter;
}
$current++;
}
Um.. no, still nothing. This time it shows the content of $links, but not associated to a node itself. For example, my node has a read/write property for comments and it should be visible inside of $links as "comment", but I can't see it this way. Am I missing something?
Comments
Comment #1
jazzitup commentedThis code doesn't return anything, but when I view it as a node, then $links are displayed:
Comment #2
mfredrickson commentedTry theme('links', $node->links);
Comment #3
jazzitup commentedIt returns a warning: Invalid argument supplied for foreach() in /DRUPAL_PATH/themes/MY_THEME/links.tpl.php on line 12.
links.tpl.php:
Comment #4
mfredrickson commentedTry pre-pending this before the call to theme('links', $node->links):
This is taken from node_view:
http://api.drupal.org/api/function/node_view/5
Comment #5
jazzitup commentedUm.. no, still nothing. This time it shows the content of $links, but not associated to a node itself. For example, my node has a read/write property for comments and it should be visible inside of $links as "comment", but I can't see it this way. Am I missing something?
nodeasblock.tpl.php: