Aggregator should have an option to "truncate" the description incase someone puts in a really really long description. Currently, aggregator does not truncate a description at all.
This patch allows you to set a "truncate" length if you want to. I will cleanly close the tag also. So if at length 100, you happen to be in an open <strong> tag, it ill place a </strong> tag at the end, and "..." before truncating.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | ag_fix(2)_0.patch | 3.45 KB | Souvent22 |
| #10 | ag_fix_truncate.patch | 3.6 KB | Souvent22 |
| #9 | ag_fix_0.patch | 3.4 KB | Souvent22 |
| #3 | ag_fix(2).patch | 3.45 KB | Souvent22 |
| ag_fix.patch | 3.42 KB | Souvent22 |
Comments
Comment #1
m3avrck commentedGreat patch. I've run into this issue a number of times too and wondered why Drupal didn't offer this.
Why is it $item['DESCRIPTION'] does it need to be in all caps?
Also, what is the $truncate - 3 about? Maybe some comments to explain it? Otherwise code looks good.
Comment #2
Souvent22 commentedThe 3 allows for my "etc.", meaning
.... So if it's too long, I stop 3 before the end, add any neccessary tags, add my etc. (...), and truncate.Comment #3
Souvent22 commentedUpdate to logic. Now empties the tag stack for any "inner" tags you may happen to be in.
Comment #4
m3avrck commentedI would say take the -3 out. The extra ... doesn't seem to be taken into consideration. I don't think people are going to be that anal about it being 75 char instead of 72 or what have you :-p
Comment #5
BachusII commentedThat would be the ellipsis character. (…) Unicode 2026.
Which means two less trips to the proctologist for those so inclined. =)
Comment #6
C-Watootsi commentedAny advance warning on whether this is 4.6 friendly? The feature offered by the patch is so useful.
Comment #7
m3avrck commentedThis won't work in 4.6. It uses the forms api for the settings. Could be modified for 4.6 though.
But in reality this will only got into 5.0 as it's a new feature.
Comment #8
Souvent22 commentedLol. BachusII, i shall reroll for those "so inclined" ;).
Comment #9
Souvent22 commentedRe-rolled, and placed in new position to make way for:
http://drupal.org/node/87497
Comment #10
Souvent22 commentedSpacing/Placement
Final patch. Ready to go IMHO
Comment #11
m3avrck commentedThis isn't needed:
$elllip = '…';... just output the ellipsis character where needed. Not to mention it is spelled wrong (one too many l)Next, all of the
if($cond)need to beif ($cond)Then the patch is done :-p
Comment #12
C-Watootsi commentedHi gang - glad to have come across this discussion here. Having some real trouble with Blogspot feeds in particular.
Any change of rolling this patch against 1.233.2.8, which is the current CivicSpace-safe version of Aggregator?
Cheers -- Case.
Comment #13
Souvent22 commentedFixed some logic, and added ellips fix.
Comment #14
m3avrck commentedThat should be a -1 in there if you're using the ellipsis character.
Comment #15
johninnit commentedHi,
Sorry for being the n00b, but am having problems getting this excellent idea to work with 4.7. I don't have CVS, so am just pasting the two blocks of code from the patch around the unchanged block in the module's file. Hope this isn't entirely the wrong thing to do!
It does introduce the options on the admin page and let me change them, and does truncate some of the feeds very nicely, though a few of them seem immune to it, and I can't work out why.
One (non blogspot) blogger one truncates mostly, but occasionally runs a whole post, whilst another never truncates. A moveable type one also never truncates, whilst another always does.
If there's anything obviously stupid I've missed, could you please point me in the right direction? Any help very gratefully accepted.
Aggregator I'm trying to get working is on the front page of www.tigmoo.co.uk
Thanks & best wishes, John
Comment #16
webchickPlease don't hijack issues. If you have a support request, post to the forums or open a separate ticket.
I believe this is for 5.x anyway.
Comment #17
webchickComment #18
jcisio commentedIt was fixed.