Disabling the “Read more” link if specific conditions are met
Here’s a simple way to remove the Read more link at the module level (in Drupal 7). Sometimes this is preferred over doing it at the theme level (because maybe we don’t want the link to appear no matter what theme is being used).
1 2 3 4 5 6 7 8 9 |
/** * Implementation of hook_node_view(). */ function mymodule_node_view($node, $view_mode) { // Remove the "Read more" links on Registrant Form teasers if ($node->type == 'regform' && $view_mode == 'teaser') { unset($node->content['links']['node']['#links']['node-readmore']); } } |