Hey guys,
I want to deposit images for members in the backend of SS3. Therefore I´ve tried to extend the member settings in "security".
CustomMember.php:
class CustomMember extends DataExtension{
private static $many_many = array(
'Images' => 'Image'
);
public function getCMSFields() {
$this->extend('updateCMSFields', $fields);
return $fields;
}
public function updateCMSFields(FieldList $fields) {
$fields->push(new UploadField('Images', 'Profile Image'));
}
}
This part of the code works fine. I can save images and documents under a name of the member.
But know I´ve tried to list the images in frontend and get the error:
[Error] Uncaught Exception: Object->__call(): the method 'fortemplate' does not exist on 'HasManyList'
MembersPage.php:
class MembersPage extends Page{
public static $has_many = array(
"CustomMembers" => "CustomMember"
);
function getMembers(){
$MemberSet = DataObject::get('Member');
return $MemberSet;
}
}
MembersPage.ss
<% control getMembers %>
$Images
<% end_control %>
How can I display the images in the frontend?
Thanks for help!