[buddypress-trac] [BuddyPress Trac] #8581: Extending no content activities with images and call of actions
noreply at wordpress.org
Sun Nov 28 19:09:18 UTC 2021
#8581: Extending no content activities with images and call of actions
Reporter: vapvarun | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: 10.0.0
Component: Activity | Version:
Severity: normal | Resolution:
Keywords: has-patch |
Comment (by imath):
I've tested your patch @vapvarun and it works great. Thanks a lot for your
work on it.
I first want to say sorry for what I'm about to write. I know both of you
already invested a lot of time into this ticket, and I must say I also
But I think it's not ready yet. We need to work a little more on it.
1. I've changed the logic to be more consistent with what I believe is the
BuddyPress way of doing things.
Instead of using a filter, I'm kind of introducing a new template into our
template hierarchy. The activity type one. It's useful here and I believe
it can also be useful for other activity types.
I also think we need the `$activities_template` global to contain the
generated content parts.
Here's how it's working now:
- use specific template parts located into the `buddypress/activity/type-
parts/` of the BP Ttemplate Pack
- Perfom a template part look up in `bp_activity_content_body()`, if a
template is found load it instead of getting the content body using
`bp_activity_get_content_body()`: this way we don't need the activity
filters anymore. I think it's also best because we were sanitizing empty
content otherwise because all the `bp_activity_get_content_body` filters
were used for nothing. You'll also see the `bp_activity_content_body()`
function is now using a new `$context` parameter so that we can control
where these template loads are occuring. I believe it should only be done
inside a Theme.
- introduce new template tags:
- `bp_activity_the_content_body()` to bypass the activity types template
parts look up or to use this tag inside an activity types template part.
- `bp_activity_has_generated_content_part()` is checking if the property
of a generated content exists
- `bp_activity_generated_content_part()` is outputing the the property of
a generated content
- `bp_activity_get_generated_content_part()` is returning the output
after making sure it has been sanitized.
- Add the generated content from `bp_activity_has_content()` making sure
to avoid as much as possible code duplication.
2. Sometimes the cover image or the avatar are disabled...
I've added checks about this and had to edit the styles a bit in case the
user has no cover image for instance. In this case including the grey
background is not great imho. So I'm just outputting the avatar.
I haven't tested, but there should be adaptations to add to styles in case
the avatar is disabled.
3. Are we covering all existing no content activities? Should we be more
creative about the layouts?
As you will see I've found at least one we were not covering so far: the
`created_group` one. We need to review the activities to find the ones
that are not covered yet.
You will also see the `friendship_created` output is the same as the
`new_avatar` one, and I did the same for `created_group` and
`joined_group` (I was a bit lazy or a bit tired).
When looking at the activity stream, we basically just outputting the user
profile header or the group profile header everytime. **I believe we
should try to make these layouts different**.
4. As @oztaser noticed, we need to allow users to manage "historical
avatars". I don't think we should delete an avatar when the corresponding
activity has been deleted. I think we should do the other way around.
Delete the activity when an historical avatar has been deleted. This means
we need a new tab inside the Avatar UI to pick an old avatar or delete old
5. Let's drop the embed activities from this feature for now.
That being said, I think the
8581.2.patch] is becoming a very huge patch. So I'd like us to keep it the
way it is (unless it can be improved) and to add the needed steps from
different patches. This will require us to apply 8581.2.patch, commit it
locally before creating new patches. We can alternatively use
[https://github.com/imath/buddypress/tree/patch/8581 this branch] of my GH
copy of trunk.
I'll try to work on adding the new Avatar UI tab in the coming days.
@vapvarun can you bring us some creativity about the layouts and check if
we're still missing some no content activities?
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8581#comment:23>
BuddyPress Trac <http://buddypress.org/>
More information about the buddypress-trac