I couldn't get the "Read More" link to show in teasers for one of my content types, then realised it was because the main text field in that content type was actually a CCK field, not the default "body" text field.
There are a couple of comments on d.o but nothing definite about how to get the Read More link showing. Is there something really obvious I'm missing?
this is what I have on my other node types and the link shows up fine:
<?php if ($node->links['node_read_more']): ?> <div> <a href="/<?php print $node->links['node_read_more']['href'] ?>"><?php print $node->links['node_read_more']['title'] ?> </a> </div> <?php endif; ?>
thanks in advance
Neil
So many things you could do...
Set up a computed field to output the link (don't forget to use l() and t() for generating anchor markup).
Use display suite / node displays to place the read more link, which that module already provides
Add code into your template.php / .tpl.php
...
I'm presuming that the below code resides in a node template (tpl.php in your theme directory). Do you have this code in the template for the type that isn't displaying read more?
Ultimately the "Read more" link just points to the node/nid. So it would be easy enough just to stick
<?php print l(t('Read more'), 'node/'.$node->nid); ?>
pretty much anywhere you want it.
On 11/11/2010 07:18 PM, Neil Coghlan wrote:
I couldn't get the "Read More" link to show in teasers for one of my content types, then realised it was because the main text field in that content type was actually a CCK field, not the default "body" text field.
There are a couple of comments on d.o but nothing definite about how to get the Read More link showing. Is there something really obvious I'm missing?
this is what I have on my other node types and the link shows up fine:
<?php if ($node->links['node_read_more']): ?>
<div> <a href="/<?php print $node->links['node_read_more']['href'] ?>"><?php print $node->links['node_read_more']['title'] ?> </a> </div> <?php endif; ?>
thanks in advance
Neil