Skip to:
Content

Opened 4 years ago

Closed 3 years ago

#2635 closed enhancement (fixed)

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

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

Description

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 4 years ago.
Screencap of the Mingle plugin Activity wall with exerpts
2635.patch (3.2 KB) - added by boonebgorges 3 years ago.
2635-2.patch (3.5 KB) - added by DJPaul 3 years ago.
2635-3.patch (3.1 KB) - added by boonebgorges 3 years ago.

Download all attachments as: .zip

Change History (16)

gene534 years ago

Screencap of the Mingle plugin Activity wall with exerpts

comment:1 r-a-y3 years ago

  • Keywords close added

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

comment:2 DJPaul3 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 http://testbp.org/activity/ for an example)

comment:3 DJPaul3 years ago

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

comment:4 boonebgorges3 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.)

boonebgorges3 years ago

DJPaul3 years ago

comment:5 boonebgorges3 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.

comment:6 DJPaul3 years ago

Tested against some Chinese and it worked fine

comment:7 djpaul3 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

comment:8 johnjamesjacoby3 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 3 years ago by johnjamesjacoby (previous) (diff)

comment:9 boonebgorges3 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.

comment:10 boonebgorges3 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.)

boonebgorges3 years ago

comment:11 r-a-y3 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?

comment:12 boonebgorges3 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.