9

I tried to remove "read more" link from the "basic page" content type. In Structure -> Content types -> Basic page -> manage display I checked "full content" and unchecked everything else and this didn't help.
Where am I doing mistake?

I found in another question the possibility to edit the template file, but I would rather do it in the settings.

thank you

8 Answers 8

8

There is no setting for that.

You can either do it with a preprocess function as explained in Remove the 'read more' and 'Add new comment' links on the home page or you can implement hook_node_view_alter(). Both is possible in a module or in a theme.

The read more link in is added in node_build_content(), and you should be able to remove just that link like this:

function yourmodule_node_view_alter(&$build) {
  if ($build['#node']->type == 'page') {
    unset($build['links']['node']['node-readmore']);
  }
}
3

As of Drupal version 7.x and 2014 May, I dare say that the correct approach to the functionality of disabling the "Read more" link would be via the installation and configuration of the Read More Control module found at Read More Control module.

There are other features that the above module is capable of, and would be the best approach to solve such issues without diving into code or hacking away at any file directly.

1

We can hide it through css. Just take the body class as parent and then node-readmore

 .parentclass .node-readmore
 {
   display: none;
 }
1

Perfect solution: Read More Control Module

Just enable and configure module.

A module to control when the teaser Read More link appears in Drupal 7.

There is no mechanism in core to decide if the read more link should appear. This means that this link will always show no matter if there is additional content to display. This module tries to overcome this issue by allowing administrators to determine how to handle this link in relation to both the content type and individual fields.

The module allows you to add Read more links to other supported view modes (RSS feed, Search results, etc) or even other supported entity types. Particularly useful if you use panels or views and either programmatically add additional view modes or use other contrib modules to provide these.

0
0

This is an other way that you can hide the read more link simply using CSS code:

.node-readmore {
     font-size: 0;
}

Edited: You have to add this code in your css override file

0

This can also be done with Panels.

  1. Create a new Panels page
  2. Click Add Content on a Panel
  3. Click 'Node' to access node related panes
  4. Click 'Node Content'
  5. Un-check 'Include node links for "add comment", "read more" etc.'

You may have to add panes for comments, etc..

0

Also, to remove the read-more from just the teaser while keeping other elements that may be using the links section (like the sharing widget from AddtoAny for example), you could do the following in a custom module:

function [your-module-name]_node_view_alter(&$build) { 
  /* remove just the read-more while preserving other elements using Links section */
  if ($build['#view_mode'] == 'teaser') {
    unset($build['links']['node']['#links']['node-readmore']);
  }
}

This also comes in handy if you're using the excellent Smart Trim module to put the read-more at the end of the trimmed summary and not in the Links section.

1
-3

You can combine Ram's, and user175...'s answer to get where you want to.

Just add this to the top of the page you want the read more's to dissapear. (e.g. inside the post that you want to have the button removed from, or in a custom block on the same page)

<style type="text/css">
.node-readmore {
     display: none !important;
}
</style>

No need to mess with css files or modules, will work on-the-fly.

1
  • Hello and welcome. Remember that answers here can get deleted. With this in your mind try to rewrite your answer, so it could make sense even if Ram's and other user's answers are gone. And don't forget proper attribution.
    – Mołot
    Commented Feb 3, 2014 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.