Closed (works as designed)
Project:
Drupal core
Version:
6.10
Component:
node system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2009 at 14:43 UTC
Updated:
18 Sep 2011 at 18:16 UTC
Current implementation of node_link() hook checks for $teaser ==1 to display "read more" link:
/**
* Implementation of hook_link().
*/
function node_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
if ($type == 'node') {
if ($teaser==1 && $node->teaser && !empty($node->readmore)) {
$links['node_read_more'] = array(
'title' => t('Read more'),
'href' => "node/$node->nid",
// The title attribute gets escaped when the links are processed, so
// there is no need to escape here.
'attributes' => array('title' => t('Read the rest of !title.', array('!title' => $node->title)))
);
}
}
return $links;
}
But i can call node_view() with anything in $teaser for theming purpose. For ex. i can generate different lists of teasers in different places of site. If $teaser contains anything but 1 it still TRUE, so simple patch solves this:
if ($teaser && $node->teaser && !empty($node->readmore)) {
And we have "read more" on all teasers.
Comments
Comment #1
jody lynnThe 'teaser' parameter of node_view expects a boolean. If you want to pass it something else to do your own theming hack you're not in supported territory.