Download & Extend

Don't display "Read More" link teaser is same length as the node body

Project:Read More Link (Drupal 6 and earlier)
Version:6.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Todd Nienkerk
Status:closed (fixed)

Issue Summary

Sometimes for certain posts, I like to display the entire post by placing the !--break-- tag at the end of a post, the only problem is Drupal still creates a "Read More" link for that post. Before, at least these "read more" links were displayed together with the other "more" links so it wasn't as obvious, but now the Read More module is making the read more link more visible when I try to display the entire post by using the !--break-- trick.

Is it possible for the Read More Tweak module to not "display" the read more link when !--break-- appears at the very end of a post? Or at least just not have it appear inline with the "teaser" text

Comments

#1

my limited experience of updating the module to 5.x tells me the addition of this feature wouldn't be trivial, but I'm just a n00b. The code, however, is very simple and doesn't take much to figure out so if you're interested you can easily apply the hack yourself and submit a patch.

#2

If this is implemented please make it only *optional* or *intelligently* determine if any more text is available. I use the break tag to intelligently break the teaser text (as it is intended) and this is usually not at the end of a post. I agree that it would be nice to not have "read more" if the break or teaser is the entire post, but not at the expense of not being able to customize a breakpoint for a teaser!

#3

This is a good suggestion.

It should be possible to detect this reliably: if this option is enabled (for those who want it to be optional) and the string '' is at the very end of the body (there are NO characters after '') don't show "read more" link at all. I'll try it out and let you all know.

#4

Version:4.7.x-1.x-dev» 6.x-3.x-dev
Component:User interface» Code
Status:active» needs review

I agree that this would be a good feature. Please find attached a patch I've just put together. This patch is against the 6.x-3.x-dev 2008-Aug-14 version of the module.

The patch simply compares the node body and node teaser (after removing the <!--break--> and any new lines). The patch also adds a new tick-box option in the settings so admins can turn the feature on and off.

EDIT: Please ignore this patch and use the one I posted in the next comment!!!

AttachmentSize
ed_readmore_compare.patch 1.55 KB

#5

Here's a slightly updated patch (which patches against the 6.x-3.x-dev 2008-Aug-14 version of the module; i.e. please ignore the patch I posted in the comment above). This new patch just removes a few more types of line break before comparing the node teaser and node body.

AttachmentSize
ed_readmore_compare.patch 1.58 KB

#6

Status:needs review» needs work

@dan_aka_jack: Major changes have been made to the 6.x-3.x-dev branch in recent weeks. Would you be willing to test it to see if it fixes this issue? Some of the work I've done may have unintentionally addressed this issue, so a patch may not be needed.

#7

Title:Remove "Read More" link if <!--break--> is placed at the end of a post» Don't display "Read More" link teaser is same length as the node body
Assigned to:Anonymous» Todd Nienkerk

My fix for the following issue may have solved this one: #294215: Read More link displayed even if node->body is empty

#8

Status:needs work» fixed

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here