Closed (won't fix)
Project:
ImageCache
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2009 at 05:10 UTC
Updated:
1 Jul 2011 at 22:35 UTC
I was talking with Drewish on IRC about this the other day. I'd like to be able to choose a preset for user pictures like you can with imagefield. I had hoped to file this issue with a patch attached but I'm putting out the white flag. Views code is just too complex for my skill level at this point. Even with some hints, I still have no clue how to make this happen.
So I'm putting it out as a feature request. Would be lovely if someone who understands views 2 code could make a patch for this. It's very helpful to anyone making views of users. In my case, I wanted it for the "friend" list in advanced profile kit. But I'm sure there are uses beyond just me.
Thanks for your time,
Michelle
Comments
Comment #1
likewhoa commentedsubscribing as this is something that would make using views+user pictures alot easier.
Comment #2
catchJust found a use case for this, and this issue was the closest thing I found. I'm not much up on the Views 2 API yet though.
Taxonomy image does a similar thing.
There's also http://drupal.org/project/imagecache_profiles - which handles flushing presets as well - this might be the best place for this to live, although leaving it against imagecache for now.
As far as I got is that imagecache_profiles should use hook_views_data_alter() to add it's own handler. This adds the options for the imagecache presets, then in render it'd need to override theme_user_picture() with a custom theme function to add the right preset in (similar to that old lullabot article). That might be enough even.
Comment #3
michelle-1 for putting this in imagecache profiles. Having to install another module just for imagecache and views to work together, especially a module that will cause other problems I then have to work around is not a good solution for me.
Michelle
Comment #4
catchThe only thing that's needed from imagecache profiles is the hook_user() to flush presets, which is pretty small, so could easily live wherever this ends up. I've not used imagecache_profiles before so no real opinion either way.
Comment #5
likewhoa commentedwe shouldn't have to rely on another imagecache based module just to integrate the user profile picture field with views. The only way now to set imagecache presets to user picture fields in views is by theming at the moment it should just be integrated like when adding image fields.
Comment #6
sunUser Display API (http://drupal.org/project/user_display) is able to solve this issue in a more generic approach. Does not require any changes in ImageCache. However, requires some love, especially a port to D6, and ultimately, adding the low-level classification of theme('user*') calls to D7 core - so the module could/would remain as UI in contrib.
Comment #7
SlipAngel commentedI would also like to see this functionality added. It would seem like views 2 should be able to do this.
Comment #8
gausarts commentedsubscribing, thanks
Comment #9
likewhoa commentedfor those that haven't already figured out how to manipulate user pictures in views with theming and imagecache here it is.
Comment #10
gausarts commentedWonderful. Works like a charm. Small typo, though, missing "$" on line #6. Perhaps you can throw me the light to use realname.module, instead? Thanks.
Comment #11
michelle@likewhoa: Yes, that will work, but this issue is about getting views support into imagecache itself so people don't need to do that. Let's please try to keep the issue on track so it doesn't get won't fix'd.
Michelle
Comment #12
gausarts commentedAwfully sorry for misbehaving. I was carried away. Gotta get back on track. Thanks for reminding.
Comment #13
michelleOh, I wouldn't call any of it "misbehaving". LOL! likewhoa is trying to help and for many people that snippet will be enough. But I didn't want the issue to get so offtrack that the maintainers just won't fix it because it's not actionable anymore.
Just to restate, what I'm looking for is the ability to choose the preset for the user picture from within the views UI like you can do now with imagefield.
Michelle
Comment #14
likewhoa commentedyea I didn't mean to take the focus off the suggested feature request, I just wanted to show the way it's done using views theming, It would be logical to have imagecache presets set instead of doing the theming and I look forward to seeing it implemented and hope a maintainer doesn't go ahead and set status to 'WON'T FIX' because this would be a 'I DON'T WANT TO FIX' to me.
Comment #15
sharifudinrizal commentedHope this will be added too, since it's pretty much the last thing I need to have for a totally great view for users.
Comment #16
drewish commentedi'm really thinking that http://drupal.org/project/imagecache_profiles is probably the best place for this. imagecache doesn't provide support for themeing user pictures so i don't think it makes sense to just add views user support. i'd be open to trying to merge in imagecache_profiles but i don't think we should do it half way.
Comment #17
michelleWell, that's won't fix then. Too bad. This is a feature many people would love. But, since I'm not showing up with code in hand, I can't blame you for not being willing to do it.
Imagecache profiles won't work for this. If I figure it out, I guess I'll have to write my own module to make imagecache work with views. I don't know if/when that will happen but will report back if I do.
Michelle
Comment #18
sunInstead of working on yet-another approach, I happily invite you to join forces for User Display API.
Comment #19
michelle@sun: Trying to avoid having to install a module with all sorts of features for one simple thing. This issue is about one thing: Making a views "formatter" or whatever it's called there that lets you choose the imagecache preset to use with user pictures. All you should need for that is imagecache and views. But since both the imagecache and views maintainers have said "not in my module" the only alternative is a 3rd module to make imagecache and views work together.
Michelle
Comment #20
drewish commentedi'm not opposed to the idea i just don't want to have part B added without part A in first.
Comment #21
michelle@drewish: I don't understand. What sort of theming would you like it to provide? If you mean overriding theme_userpicture(), that's a mess you don't want to get into and what imagecache profiles does, IIRC. The trouble is that you want different sizes in different places and it can be very hacky to determine what size you want when you are overriding a generic theme function like that. With views, it's very explicit. You want this view field to be this size. Same as imagefield does for imagefields in views.
Michelle
Comment #22
atelier commentedI'm one of the "many people" Michelle cited who would very much like to see this functionality added. This would be particularly useful for community-based sites, which, by necessity, already incorporate many other contributed modules. Adding to the overhead with yet another module (for something so basic) is something I'd rather avoid.
Comment #23
Geekish commentedI have Imagecache applied to user pictures in my views now, thanks to this thread: http://drupal.org/node/349331 (comment #24 especially helped me).
It uses Imagecache_Profiles, and a patch to the aforementioned module which gives it Views compatibility. If you know how to patch okay, you might want to give it a try. The maintainer seems rather busy elsewhere, so I don't know when he'll commit the patch...
Of course, this is no good if you are really trying to avoid having to add another module, but I felt the patched Imagecache_Profiles was worth the additional resources for me.
Comment #24
michelleJust a note. I finally learned how to make a views field and it's actually not hard at all. So I will be implementing this myself. Since the imagecache folks don't want it, I guess it will be an APK feature when I get back to that in July.
Michelle
Comment #25
Michsk commentedWhy should we not be able to manipulate user pictures with views and imagecache but be able to manipulate normal images. Thats just very odd to me.
Comment #26
michelleUgh... I really should learn to not write down that I'm going to do anything until it's done. 2 years later and I never did do this and likely won't any time soon, if ever.
Michelle
Comment #27
Michsk commentedlol