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 | 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)
Change History (16)
#1
@
14 years ago
- Keywords close added
It's relatively easy to put together something like this as a plugin.
#2
@
14 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)
#4
@
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.)
#5
@
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.
#8
@
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.
#9
@
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
@
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
@
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?
Screencap of the Mingle plugin Activity wall with exerpts