Skip to:

Opened 14 years ago

Closed 13 years ago

#2635 closed enhancement (fixed)

Long Activity stream posts should show an exerpt with a "read more" link

Reported by: gene53's profile gene53 Owned by:
Milestone: 1.5 Priority: major
Severity: Version:
Component: Activity Keywords: 2nd-opinion


Long Activity stream posts should be truncated after X number of characters and only a post excerpt with a read more link should be shown.

Attachments (4)

ishot-1.jpg (84.6 KB) - added by gene53 14 years ago.
Screencap of the Mingle plugin Activity wall with exerpts
2635.patch (3.2 KB) - added by boonebgorges 13 years ago.
2635-2.patch (3.5 KB) - added by DJPaul 13 years ago.
2635-3.patch (3.1 KB) - added by boonebgorges 13 years ago.

Download all attachments as: .zip

Change History (16)

14 years ago

Screencap of the Mingle plugin Activity wall with exerpts

#1 @r-a-y
13 years ago

  • Keywords close added

It's relatively easy to put together something like this as a plugin.

#2 @DJPaul
13 years ago

  • Keywords 2nd-opinion added; close removed

I think showing an excerpt is a good idea as it prevents full-page activity stream spam (check today's for an example)

#3 @DJPaul
13 years ago

  • Component changed from Core to Activity
  • Priority changed from normal to major

#4 @boonebgorges
13 years ago

2635.patch is a first swing at this. DJPaul, would you mind having a look to see if you like this strategy? I'm not married to the way that the 'read more' link is rendered or anything. And it's hard to test 100% because single activity permalinks are broken.

(BTW it turns out that bp_create_excerpt actually is pretty smart - its value is passed through a force_balance_tags etc. So I used it.)

13 years ago

13 years ago

#5 @boonebgorges
13 years ago

2635-2.patch looks like a nice improvement.

I haven't got time at the moment, but this should probably be tested with non-Latin, multibyte character sets.

#6 @DJPaul
13 years ago

Tested against some Chinese and it worked fine

#7 @djpaul
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4213]) Truncate display of long activity stream posts, adds read more link. Fixes #2635, props boonebgorges and paulgibbs

#8 @johnjamesjacoby
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I think the "Read More" link should ajax load that exact activity stream item to show the rest of it. This is more consistent with the typical activity stream behavior.

Taking you to the single stream is a redundant use of the "View" link, which is also already appended. I don't think it makes sense to have two links on the same activity stream item, that take you to the same thing.

Last edited 13 years ago by johnjamesjacoby (previous) (diff)

#9 @boonebgorges
13 years ago

Agreed that an AJAX load is better, but Paul and I talked and thought that this would be a good solution until the AJAX loader was built - plus we need a noscript fallback anyway. Graceful degradation and all that. So the AJAX can go on top of what's already here.

#10 @boonebgorges
13 years ago

2635-3.patch is a first go at the AJAX implementation. I'm posting it here first because AJAX best practices are not my specialty. My method works fine, I just want someone else to verify that the method I'm using for element selection is fairly efficient. (I had previously tried some jQuery.parents() trickiness but it seemed appreciably slower.)

#11 @r-a-y
13 years ago

Instead of returning false in the AJAX function, you should use exit().

Also should apply the 'bp_get_activity_content' filter on $activity->content; exit() also works like echo() as well:
exit( apply_filters( 'bp_get_activity_content', $activity->content ) );

Haven't tested the patch, but does it work for activity comments as well?

#12 @boonebgorges
13 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4239]) Adds Read More functionality to activity comments. Adds AJAX functionality to activity Read More. Fixes #2635. Fixes bugs with the way that activity comment content and meta links are displayed. Fixes #3168.

Note: See TracTickets for help on using tickets.