Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to place a custom "read more" link on the front page only if there is more content to be read.
if ($is_front && $readmore): /*$readmore is throwing an error*/
print $node_url; ">Continue reading this post »
endif;
Notice: Undefined variable: readmore in include() (line 129 of C:\drupal\sites\all\themes\test1\templates\node.tpl.php).
I'm using Drupal 7.0-beta1.
Comments
Comment #1
JohnAlbinInteresting. $readmore is documented in the node.tpl.php, but isn't used in the actual display of the node.
If it really isn't initialized, its a core bug. But we can work around that in Zen in the mean time.
I'll test this soon.
Comment #2
JohnAlbinI was wrong about being able to work around it in Zen. The problem is with node module. See #823380: Read More link is always visible on teaser.
The best I can do is note that the variable is broken in the docs. :-\ http://drupal.org/cvs?commit=502674
Marking this postponed until the core issue is resolved.
Comment #3
JohnAlbinIt doesn't look like that core issue will be solved for D7.
Comment #4
JohnAlbin