Closed (fixed)
Project:
Privatemsg
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2009 at 13:18 UTC
Updated:
6 Jun 2011 at 11:11 UTC
Hello,
Thanks for this great module! I am closely following the many developments and hope to be able to contribute by testing =)
I was wondering if it is currently possible to have the user's content profile 'field_profile_pic' (using cck imagefield/imagecache) to show to the left of the messages of privatemsg? I believe this would be a great addition and add flavor to the messages page =)
I hope someone will be able to comment/support.
Thank you!
Comments
Comment #1
igorik commentedI am not sure how to do that by theme on message list (probably question for module maintainer), but inside message you can do anything, just edit privatemsg-view.tpl.php and replace user picture by user profile image. You can use $content_profile->get_variable() - more info in readme of content profile.
I am sure when the message list will be done by views (someday in the future), the you can show there any image you want using fields in views.
There is one more thing you can do it now, it is completly replace standard drupal user avatar with content profile image. Then there will be needed no changes in privatemsg because there will be shown your content profile image instead drupal avatar.
Watch out, this change will be on whole page.
Add file user-picture.tpl.php into your theme directory (you can copy this file from user module I think)
and inside this file replace code with your own code with something like this (use your own imagecache name and variable)
I am using it this way on our site because I don't like limits of drupal avatar and I like the way of imagefield. In this case it is the best remove standard drupal avatar completly from the system (unset from user account), and to give to user an option to insert it in his content profile imagefield - example: http://www.somvprahe.sk/user/matya
Comment #2
berdirigorik imho already answered the question, just a few comments.
Views support won't be available any time soon, our queries are simply way to complicated for Views integration right now. However, we actually use almost the same system as views does use to theme the different columns.
Documentation: http://blog.worldempire.ch/api/group/theming/1
However, from what I understood, trupal218 simply wants to display the image when viewing a specific thread, not on /messages. And you already described the possible ways to do that.
Do not edit the file in place as it will be overwritten when you update privatemsg.module. Instead, copy it to your theme directory, rebuild the theme registry and then edit it. You probably meant that, but it's not clear from that description.
@trupal218: Please set this to fixed if you have enough information.
Comment #3
Bilmar commentedThank you both for the great info!
I will be spending a lot of time this weekend customizing privatemsg - awesome module!
P.S. Sorry for the delayed reply, having on-and-off access to internet this week.
Comment #5
Heihachi88 commentedSorry for reopening this thread, but i can't figure out how to make it work. Tried exactly what igorik said:
Placed user-picture.tpl.php and replaced:
with:
i'm getting only white screen of death after these actions. What i am doing wrong? (i'm using content_profile module)
And indeed i want to display cck imagefield when viewing a specific thread e.g. http://mysite.kz/messages/view/2
Comment #6
berdirWSOD means that you have a syntax error or something like that in your code.
See http://drupal.org/node/158043 on how to display errors.
Comment #7
Heihachi88 commentedi've added:
to index.php, And still when WSOD happens i dont see any errors!
Comment #8
berdirWell, you surely can't simply use a something like "$content_profile->get_variable('profile', 'field_photo');" that needs to come from somewhere.
I guess igorik is getting that from somewhere, I can't help you since I've never used content profile. I suggest you try to ask in IRC, the forums or http://drupal.stackexchange.com.
Comment #9
Heihachi88 commentedsolution is here:
http://webcoder.kz/content-profile-cck-image-privatemsg
Comment #10
Heihachi88 commented