Hiding node links using CSS
While manipulating node links is best done using Drupal's hook_link_alter()
function, sometimes adding a couple of lines of simple CSS can do the trick rather neatly as well. In this recipe, we will look at hiding only the Read more link from a node's teaser display. To make things a little more interesting, we will be doing this solely for authenticated users and, as a further restriction, limit it only to story nodes.
Getting ready
We will be using the myzen theme created earlier in this book as the example theme in this recipe. It is assumed that sample story nodes are available and that they are displayed as teasers in node listings to ensure that the Read more link is displayed. Teaser configuration can be performed via the Post settings form accessible at admin/content/node-settings
(Home | Administer | Content management | Post settings).
How to do it...
Since we are using the myzen theme, we can add our CSS rules to a file dealing with node display.
Navigate...