Blog Listing Displays User Avatars Instead of Blog Avatars
In the listing of all blogs, I see avatars of members: http://commons.gc.cuny.edu/blogs/
Blogs don't really have avatars, so maybe this is by design? If so, I don't remember seeing it before, and I don't think it should be the case. Can you let me know what should be shown there, and then we'll take it from there?
#1 Updated by Boone Gorges almost 11 years ago
- Status changed from Assigned to Reporter Feedback
- Target version set to Future release
This is intended behavior. From the inline docs:
* In future BuddyPress versions you will be able to set the avatar for a blog.
* Right now you can use a filter with the ID of the blog to change it if you wish.
* By default it will return the avatar for the primary blog admin.
The only obvious option is to shut off the avatars altogether.
#3 Updated by Matt Gold about 10 years ago
Maybe some version of the header image, if there is one? Maybe people should be able to pick a blog avatar when they set up their blogs (and edit it later)? I do think it's important, since it shows up in sitewide blog listings and also affects blogs when we feature them on the homepage.
#4 Updated by Boone Gorges about 10 years ago
Themes all store their header images differently, so pulling it automatically will be next to impossible. Providing a mechanism for blog owners to upload a custom blog avatar is possible, though it essentially adds a pretty extensive bit of functionality to BP. I would argue that this is not, in fact, very important, at least when compared with other, higher impact items on our roadmap, but I'm willing to defer to you if you think it matters that much. If we go ahead with your suggestion (instead of my preference of leaving things as is - easiest - or removing them altogether - also pretty easy), we'll have to make some decisions about how the feature would work. Do you put the ui in BP (if so, where?) Or on the dashboard?
#5 Updated by Matt Gold about 10 years ago
I'm okay with leaving things as they are. The more I think about it, the more I think that the real issue is only on the Featured Content widget, since that's when it really feels odd to have someone's photo up there so prominently (and I know that some members feel embarrassed about that). I'll create a separate ticket if you think that's a more focused and useful way forward.
#6 Updated by Boone Gorges about 10 years ago
Yes, I think that adding the feature to the Featured Content widget is more sensible, since the UI is mostly already there. Please do open a ticket for it, and we can assign it a milestone, and leave this one in future release for when we have more resources.
#8 Updated by Boone Gorges over 9 years ago
- Status changed from Reporter Feedback to Assigned
- Assignee changed from Boone Gorges to Dominic Giglio
- Priority name changed from Normal to Low
Dom, could you take a look at the way BP implements group and user avatars, and get a sense of what it would take to port the infrastructure to the blogs component?
#9 Updated by Dominic Giglio about 9 years ago
This is an interesting issue. There seems to be some code that's already been added to BP to handle this kind of functionality in the future. From what I could gather so far, the blogs page is getting the user's avatar during a BP loop by calling bp_blog_avatar(). That function is defined in the BP_Blogs_Template class on line 275 of bp-blogs-template.php. There's a slightly confusing comment right in the middle of bp_get_blog_avatar() which you've already partially quoted above:
/*** * In future BuddyPress versions you will be able to set the avatar for a blog. * Right now you can use a filter with the ID of the blog to change it if you wish. * By default it will return the avatar for the primary blog admin. * * This filter is deprecated as of BuddyPress 1.5 and may be removed in a future version. * Use the 'bp_get_blog_avatar' filter instead. */
It's the second part of the comment that confuses me. It says to "Use the 'bp_get_blog_avatar' filter instead," but the code right below that DOES use that filter. Maybe BP core was recently updated but the comment wasn't? I can see where bp_core_fetch_avatar() is being called in the filter (line 302), so I understand why a user's avatar is being displayed by default. The new code I mentioned above is actually in bp_core_fetch_avatar(), one of the defaults is
'object' and its inline comment states:
// user/group/blog/custom type (if you use filters). So it looks as if this feature has gone beyond planning, it just hasn't been fully implemented.
The DB part shouldn't be too hard, I think adding a new class variable to BP_Blogs_Blog that stores an 'avatar' value from the wp_bp_user_blogs_blogmeta table should work fine. It could then be referenced and checked elsewhere in the code to output a blog avatar when one exists and fallback on a user's when there is no blog avatar.
The missing piece of the puzzle seems to be the UI. Where do you have a user enter a url to (or upload) an avatar image? Do you build a form into BP core that can be called on the sites page? Do you add a page in the dashboard? (I don't like the dashboard idea, too many people don't use/understand the dashboard enough) Right now there is no other UI for blogs than the create page.
So it would appear that we could approach this issue from one of two different directions. We could work on a BP patch that adds the code to support these ideas. Or we could add this feature directly to the commons. Most of the code needed to let a user associate an avatar with there blog appears to exist. It would be a matter of building a UI for them to input their avatar. I think using filters we could check for an image in an upload dir and display it if it exists. All the code for that seems to already be in bp_core_fetch_avatar().
Let me know what you think when you have a minute, maybe this should move to a back burner until after 1.4?
#13 Updated by Michael Smith about 7 years ago
I thought I'd update this considering the new My Commons personal homepage which is about to be released. It would be nice to have a blog avatar so that we could use the nested avatar look similar to the group avatar with individual making an update. Also I noticed it looks particularly confusing when you are logged-in and visit your 'My Sites' page and see your own avatar for every blog in the list.
As far as a UI that we could use for existing sites, possibly the My Sites page could prove useful. Possibly filtering by blogs which you administrate (though that would be another feature as well). As part of this process we may need to create a default blog avatar, it would prevent confusion with personal avatars as well as serve as a prompt to consider adding a custom avatar.
#16 Updated by Boone Gorges over 6 years ago
- Assignee changed from Dominic Giglio to Boone Gorges
- Target version changed from 1.8 to 1.9
Gonna punt this one again. BuddyPress 2.3 is likely to include a rewrite of the way that group and user avatars work. One of the eventual goals of this will be to allow for the easier spinning-up of things like blog avatars. Once BP 2.3 is out, I'd be glad for us to build this BP feature on CAC time, but building the more general attachment API is probably outside of a reasonable scope for us, and in any case will probably not be doable for 1.8.
#19 Updated by Boone Gorges almost 2 years ago
- Status changed from Assigned to Resolved
- Target version changed from Future release to 1.10.2
Since version 2.7, BuddyPress has this feature built in: by setting the WP site icon (Dashboard > Customize > Site Identity), you can set the site avatar. We'll call this fixed as of Commons 1.10.2.