Add ellipsis marks before readmore link

aaron - September 14, 2009 - 15:36
Project:Read More link (Drupal 6 and earlier)
Version:6.x-5.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

This patch adds configurable ellipsis marks (...) between the teaser and the 'Read More' link.

AttachmentSize
ed_readmore-ellipsis.patch1.58 KB

#1

aaron - September 14, 2009 - 15:42
Status:active» needs review

forgot to set status

#2

aaron - September 14, 2009 - 15:46

that should really be check_plained so we don't end up with a security alert... :P

new patch attached.

AttachmentSize
ed_readmore-ellipsis-577062-2.patch 1.59 KB

#3

aaron - September 14, 2009 - 16:23

Here, this one is even better: it takes the   and moves it into the variable, and puts the whole thing in the theme layer, where it belongs. Also using filter_xss rather than check_plain, so we can see the HTML for the hard space properly (in addition to anything else an admin might want to stick in there, such as … (…). In fact, this uses that for the ellipsis anyway (the character for three dots…, rather than three periods..., which can sometimes be better for typesetting). This allows editors to change that to ... (...), . . .  (. . . ), & #x2026; (…), & #8230; (…), an image, or whatever their needs require.

#4

aaron - September 14, 2009 - 16:20

a patch would be nice, of course...

AttachmentSize
ed_readmore-ellipsis-577062-4.patch 2.44 KB

#5

Todd Nienkerk - September 14, 2009 - 18:48

aaron: This is awesome. Thanks!

Let's change the notion of "ellipsis" to a more generic "separator." The default should be a single, non-breaking space. Can this be done without double-encoding these characters on output?

#6

aaron - September 14, 2009 - 18:54

done. and are the characters being double-encoded for you? they shouldn't be, as I'm using a straight filter_xss.

AttachmentSize
ed_readmore-ellipsis-577062-6.patch 2.43 KB

#7

aaron - September 14, 2009 - 19:00

changed all variables to $separator, removing all last vestiges of $ellipse.

AttachmentSize
ed_readmore-ellipsis-577062-7.patch 2.44 KB

#8

Todd Nienkerk - September 15, 2009 - 19:24
Status:needs review» fixed

This has been committed and will be released as 6.x-5.0-RC2. Thanks!

#9

System Message - September 29, 2009 - 19:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.