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.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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.
+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?
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.
class MemberDecorator extends DataObject Decorator {
function extraStatics() {
return array (
'has_one' => array('Avatar' => 'Image')
);
}
function updateCMSFields(&$fields) {
$fields->addFieldToTab("Root.Avatar", new ImageField('Avatar'));
}
}
_config
Object::add_extension("Member", "MemberDecorator");
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com
You are a bit of a boss UC.
Thanks!
gvelasquez85 to see all the members simply go to: yoursite.com/my-member-profile-page/show
and if you need it a log out link would be <a href="Security/logout">log out</a>
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 MemberProfileFieldsSection.ss 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
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.