Here's some code you can drop into a custom module for your site.
<?php // custom is the name of the module function custom_link_alter(&$node, &$links) { // only alter links on teasers if ($node->teaser) { // step through each link on this node foreach($links as $module=>$link) { // we let the read more link past, but delete all the others if ($module!='node_read_more') { unset($links[$module]); } } } } ?>
Yep that'll work as well - though not as cleanly as using a module. Just be careful as theme_links is called by menus and all sorts so it would be easy to break the site.
As far as I can tell, $node->teaser is set at this point whether the node is being shown as a teaser or in full -- is there a way of distinguishing between teaser and full context?
Hi All,
I have been reading a lot about modifying the teaser, including the module that changes the location where it is displayed. But I do not want to use that functionality at all. I just want the pages to be displayed fully. No Read more links.
Can someone help me and tell me how to do that?
Rob
hook_links_alter
hook_links_alter or change you theme. There are many posts out here about how to do it.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
hook_link_alter()
By implementing hook_link_alter() whithin a module you can play around with the links.
$links
I'm not sure how to do that. I've seen the hook_link_alter() page but it assumes prior knowledge of information that I don't know where to find...
Here's some code you can
Here's some code you can drop into a custom module for your site.
<?php// custom is the name of the module
function custom_link_alter(&$node, &$links) {
// only alter links on teasers
if ($node->teaser) {
// step through each link on this node
foreach($links as $module=>$link) {
// we let the read more link past, but delete all the others
if ($module!='node_read_more') {
unset($links[$module]);
}
}
}
}
?>
$links
Thanks for the tip, but I'm not sure how to make a module. Is there a way to do it without creating a module?
Right now I'm doing something like:
<?php if ($page) {print ($links);
} else {
print(l('Read More', "node/$node->nid"));
}
?>
But that doesn't work if I want a little more control—like maybe also leaving the link to the author's blog.
Docs
Just found the answer here:
http://drupal.org/node/134442
Yep that'll work as well -
Yep that'll work as well - though not as cleanly as using a module. Just be careful as
theme_linksis called by menus and all sorts so it would be easy to break the site.As far as I can tell,
As far as I can tell, $node->teaser is set at this point whether the node is being shown as a teaser or in full -- is there a way of distinguishing between teaser and full context?
Remove te Read More link completely
Hi All,
I have been reading a lot about modifying the teaser, including the module that changes the location where it is displayed. But I do not want to use that functionality at all. I just want the pages to be displayed fully. No Read more links.
Can someone help me and tell me how to do that?
Rob
you should start a new post
This is unrelated to the current conversation.
Look in /admin under the content stuff for post settings.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
Change your Teaser length to unlimited
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database