Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 16 months ago

#8052 closed enhancement (fixed)

Suggestion for Activity Stream - link to Post

Reported by: bee360's profile bee360 Owned by: imath's profile imath
Milestone: 11.0.0 Priority: normal
Severity: normal Version: 4.1.0
Component: Blogs Keywords: dev-feedback has-patch has-unit-tests
Cc: sbrajesh

Description

Hi Team,

When Activity Stream includes to show new blog posting, blog content excerpt will be shown with [...] at the end, not even "read more", etc. (will be great to add ability to config and set the actual word for "read more"). To review the actual post, user would need to click the post subject or the time stamp, which seems not a great experience for users.

That will be definitely a great improvement in user experience if the blog content excerpt turned to be a clickable link to the actual post, which brings similar Facebook experience to click on the wall to reach the post page with comments showing at the bottom.

Thanks for reviewing.

Attachments (2)

8052.patch (1.5 KB) - added by sbrajesh 2 years ago.
8052.2.patch (7.2 KB) - added by imath 21 months ago.

Download all attachments as: .zip

Change History (29)

#1 @boonebgorges
5 years ago

  • Component changed from Core to Blogs
  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Awaiting Contributions
  • Priority changed from strategic to normal

This is a great idea.

#2 @teeboy4real
2 years ago

I also agree with this suggestion, I raised similar issue for clickable featured images at https://buddydev.com/support/forums/topic/turn-activity-featured-image-into-clickable-links/

#3 @sbrajesh
2 years ago

  • Cc sbrajesh added
  • Keywords has-patch added; needs-patch removed

Hi,
Here is a patch attached to link the featured image to the blog post.

Is it feasible to have it in the core now?

Thank you

@sbrajesh
2 years ago

#4 @imath
2 years ago

  • Milestone changed from Awaiting Contributions to 11.0.0

Sure @sbrajesh !

Thanks for the patch. Let's include this into 11.0.

#5 @sbrajesh
2 years ago

Thank you @imath

#6 @teeboy4real
2 years ago

@sbrajesh Will the activity (post excerpts) also be turned into clickable links?

Thanks

#7 @imath
21 months ago

In 13298:

Turn blog post’s activity featured image into a clickable link

Props sbrajesh

See #8052

@imath
21 months ago

#8 @imath
21 months ago

  • Keywords 2nd-opinion added; good-first-bug removed

I've just added 8052.2.patch to complement @sbrajesh work with improvements about the activity content generated.

This is what I get without the 8052.2.patch applied:

https://cldup.com/nD7gvLFjtO.png

As you can see, the generated layout is pretty ugly. I believe the image should be on the left side and the text on the right side.

Moreover to take in account a bit more the main purpose of the ticket description, I've added a new ending [...] looking more to what happens when WordPress manages the <!-- more --> comment. + If a theme is adding some custom "read more text & link" it will also be used into the activity.

Finally I've added the Post title (including a link to the post) at the beginning of the generated activity. This way if a post has not featured image it can be used to open the post page.

This is what I get once the 8052.2.patch is applied:

https://cldup.com/OpgIEMaDCg.png

What's your opinion about these improvements?

#9 @teeboy4real
21 months ago

  • Keywords good-first-bug added; 2nd-opinion removed

@imath will this updates also work for other custom activity updates registered by other post types and not just blog posts only.

Example
Activity updates from from custom post types like adverts, events, jobs etc

#10 @teeboy4real
21 months ago

I would prefer the image width to be 100% as I would like the display to be optimized for mobile phone display just like how Instagram photos fill the screen

#11 @imath
21 months ago

Thanks for your feedbacks.

This layout is specific to new_blog_post activity type, so it won't be used for custom post types activity types.

I'll see what I can do about the image width.

#12 @imath
21 months ago

@teeboy4real Forcing BuddyPress to use the full size featured image is something you can already achieve in BuddyPress using the bp_activity_create_summary_extractor_args filter. See an example of code here: https://gist.github.com/imath/84678e53db7ac2fe36e7ac589cea6c8b

Here's how 8052.2.patch combined with the code from the Gist looks like on desktop:

https://cldup.com/q7e979F_38.png

On a mobile:

https://cldup.com/-Lr0PVcx5W.png

#13 @teeboy4real
21 months ago

@imath thanks for the feedback, I'm really satisfied with the display as they look more engaging.

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


21 months ago

#15 @imath
20 months ago

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

In 13305:

Improve the new_blog_post activity type layout

These type of activities are generated when a blog post is published. If [13298] already brought some improvements making the included post featured image clickable, this changeset complement the first one:

  • by adding the post title into the activity content and linking it as well as the "read more" ellipsis to the post permalink. This "read more" link is generated using the WordPress the_content_more_link filter which means if your theme is using this filter to adapt the "read more" link, these adaptations will also be applied to the activity "read more" link.
  • by changing the markup used into these activities and by adding some CSS rules to make them looks more like WordPress embeds.

Props teeboy4real

Fixes #8052

#16 @teeboy4real
20 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

@imath I noticed this with the post title appearing in two places I think the first should be removed since its already added to the new layout.

See image at https://ibb.co/X3VC7Sc

Last edited 20 months ago by teeboy4real (previous) (diff)

#17 @imath
19 months ago

  • Keywords dev-feedback added; ui-feedback good-first-bug has-patch removed

Thanks for your feedback @teeboy4real. To be honest, I also thought about it but when I've looked at how we build this Post Link in bp_blogs_format_activity_action_new_blog_post() I've hesitated and I'm still doing so. The goal of these "format_activity" functions was to improve multilingual community sites as these are fired at run time (compared to having the action inside the activity db table). We currently use an activity meta to retrieve the post title for this link, this activity meta is updated each time the post is updated etc... So there's a lot of code involved there. I'm fine with making this move as it's precisely avoiding all this code and it should avoid some DB queries. But I'd like some other team members opinion about it as it's a wider change.

#18 @teeboy4real
19 months ago

@imath I think the alternative would be to add a CSS class to the first post title so it can be hidden via CSS

Display; none

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


19 months ago

#20 @imath
19 months ago

Hi @r-a-y, I'd be very interested to have your opinion about the change I'm suggesting to do in #comment:17 🙏 😁. Thanks in advance for your help.

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


18 months ago

This ticket was mentioned in PR #27 on buddypress/buddypress by @imath.


17 months ago
#22

  • Keywords has-patch has-unit-tests added

Stop using the post link into the new_blog_post activity action.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8052

#23 @imath
17 months ago

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

In 13342:

Stop using the post link into the new_blog_post activity action

Now the post link is included into the activity content (see [13305]), displaying it into the activity action is no more needed.
This commit also :

  • introduces a new function to get a site's URL and Name out of BP Blogs meta which avoids some code duplication in new_blog, new_blog_post and new_blog_comment activity action format callbacks.
  • improves the new_blog_post activity content layout when the corresponding post's image is not the featured one.
  • properly deprecates pre-2.0 activity action filters.

Props teeboy4real

Closes https://github.com/buddypress/buddypress/pull/27
Fixes #8052

#24 @teeboy4real
16 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hello @imath

Can you add the same design support for activities created by custom post types so the styling can be uniform.
I use a classified plugin (wpadverts.com) with a buddypress addon but the activity styling is different from post activities

This code was sent to change the advert activity

/* Change buddypress wpadverts activity display format */
add_filter( "wpadverts_bp_activity_add_params", function( $args, $post_id ) {
    $content = "";
    /** Insert Ad Content */
    $content .= "<br/>". get_the_excerpt( $post_id ) . "<br/>";
    /** Insert Ad Price */    
    $content .= "<b>". adverts_get_the_price( $post_id ) . "</b>";
    /** Insert Ad Image */
    $image_id = adverts_get_main_image_id( $post_id );
    if( $image_id ) {
        $content .= sprintf( '<img src="%s" alt="" /> ', adverts_get_main_image( $post_id ) );
    }
    $args["content"] = $content;
    return $args;
}, 10 , 2);

Kindly see link below for more info

https://wordpress.org/support/topic/buddypress-update-2/

#25 @imath
16 months ago

Hi @teeboy4real I’m not sure I understand the code part.

If it’s can BuddyPress include a filter to a plugin extending BuddyPress ? It’s weird, just like if I would ask WordPress to extend BuddyPress ??

I’ll check what we’re doing to let plugins manage the activity output but if it’s « use a callback function », then the best placed is the Plugin author…

Last edited 16 months ago by imath (previous) (diff)

#26 @teeboy4real
16 months ago

Hi @imath,

My focus is for buddypress to provide a guideline or filter for uniform design styling to activities created from custom post types.

Activities of posts, ads, events, jobs etc should appear similar.

Hope my suggestion makes any sense

Thanks

#27 @imath
16 months ago

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

Ok, let's see how this new design is welcomed for the Post post type and think about how to reach your statement in next release, considering not every post type supports the featured image feature etc.. , story about it continues there: #8779

For the post post type, the goal was reached so I'm closing this ticket.

Note: See TracTickets for help on using tickets.