Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Member Profiles - Adding an avatar field

Go to End

10 Posts   2496 Views


2 July 2011 at 10:59am Community Member, 24 Posts

Hi, does anybody here use the member-profiles module by ajshort?

Has anybody tried adding an avatar upload field? I've tried a couple of things like using the Dataobject Decorator, to no avail.

Some light shed on this would be fab, thanks.


12 July 2011 at 4:00pm Community Member, 11 Posts

+1 I need something like that... and... has anybody idea on how to list all the users? or maybe the online users? or something like that?


12 July 2011 at 5:50pm Community Member, 244 Posts

Have you tried adding a has_one link to an Image object in your extension/decorator? You may also need to use updateMemberFormFields() to replace the default field type with a SimpleImageField.


13 July 2011 at 1:44am 4085 Posts

class MemberDecorator extends DataObject Decorator {

function extraStatics() {
return array (
'has_one' => array('Avatar' => 'Image')

function updateCMSFields(&$fields) {
$fields->addFieldToTab("Root.Avatar", new ImageField('Avatar'));


Object::add_extension("Member", "MemberDecorator");

SilverStripe tips, tutorials, screencasts and more:


13 July 2011 at 2:14am Community Member, 24 Posts

You are a bit of a boss UC.



11 November 2011 at 12:08am Community Member, 30 Posts

gvelasquez85 to see all the members simply go to:

and if you need it a log out link would be <a href="Security/logout">log out</a>


11 November 2011 at 3:25am (Last edited: 11 November 2011 3:25am), Community Member, 30 Posts

I'm implementing the Members Profile module on my website and like you've had, I'm having some problems with the avatar.

I've seen the solution you suggested Uncle Cheese. I've implemented it no problem, I can upload the avatar when I edit a member in one of the security group in the CMS.

Now though, I have 2 problems:
1) I don't know how to show the avatar on the profile list and the profile of the single user. I've tried this in but didn't work, nothing was returned:

<% if Avatar %>
<% control Avatar %>$CroppedImage(70,70)<% end_control %>
<% end_if %>

2) when you create a new profile in the front end of the website you are able to upload an avatar from there, is it the same thing of uploading the avatar from the CMS? I'm bit confused!

Thanks a lot


15 December 2011 at 1:54am Community Member, 95 Posts

yes i'd like to know that too.

Unclecheese code works , but that seems to only be if you want to manage in the CMS. Unless I'm missing something

I'd like to know how to allow registering and registered Members the ability to upload an Avatar.

I have MemberProfiles Module installed and have added MemberDecorator.php to mysite. (good idea keeping things separate)

I think i somehow need to add to the RegisterForm() without editing the actual MemebrProfile php files.

Go to Top