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.

Comments

m3avrck’s picture

Great 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.

Souvent22’s picture

The 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.

Souvent22’s picture

StatusFileSize
new3.45 KB

Update to logic. Now empties the tag stack for any "inner" tags you may happen to be in.

m3avrck’s picture

I 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

BachusII’s picture

That would be the ellipsis character. (…) Unicode 2026.

Which means two less trips to the proctologist for those so inclined. =)

C-Watootsi’s picture

Any advance warning on whether this is 4.6 friendly? The feature offered by the patch is so useful.

m3avrck’s picture

This 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.

Souvent22’s picture

Lol. BachusII, i shall reroll for those "so inclined" ;).

Souvent22’s picture

StatusFileSize
new3.4 KB

Re-rolled, and placed in new position to make way for:

http://drupal.org/node/87497

Souvent22’s picture

StatusFileSize
new3.6 KB

Spacing/Placement

Final patch. Ready to go IMHO

m3avrck’s picture

Status: Active » Needs work

This isn't needed:

$elllip = '&hellip;'; ... 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 be if ($cond)

Then the patch is done :-p

C-Watootsi’s picture

Hi 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.

Souvent22’s picture

Status: Needs work » Needs review
StatusFileSize
new3.45 KB

Fixed some logic, and added ellips fix.

m3avrck’s picture

Status: Needs review » Needs work

That should be a -1 in there if you're using the ellipsis character.

johninnit’s picture

Version: x.y.z » 4.7.0
Category: feature » support
Priority: Normal » Minor
Status: Needs work » Active

Hi,

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

webchick’s picture

Version: 4.7.0 » 5.x-dev
Category: support » feature
Priority: Minor » Normal

Please 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.

webchick’s picture

Status: Active » Needs work
jcisio’s picture

Status: Needs work » Fixed

It was fixed.

Status: Fixed » Closed (fixed)

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