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

JohnAlbin’s picture

Interesting. $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.

JohnAlbin’s picture

Title: $readmore doesn't seem to be initialized in node.tpl.php » $readmore variable is missing from node.tpl.php
Status: Active » Postponed

I 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.

JohnAlbin’s picture

Component: PHP Code » layout.css

It doesn't look like that core issue will be solved for D7.

JohnAlbin’s picture

Status: Postponed » Closed (won't fix)