Find and open the config.yml file here
\mysite\_config\config.yml
add this:
# My new member formfields
Member:
extensions:
- MyMemberExtension
(only use spaces for indents - no tabs)
Next
make a new file in the \mysite\code\ directory called MyMemberExtension.php
This is my example of the file "MyMemberExtension.php" with the fields that I added. Just modify according to your needs and now the fields will show up on your memberprofile page inside the admin section of SS.
<?php
// mysite/code/MyMemberExtension.php
class MyMemberExtension extends DataExtension {
private static $db = array(
'CURDEBT' => 'Varchar(8)',
'username' => 'Varchar(60)',
// 'geburtstag' => 'Date',
'geburtstag' => 'Varchar(20)',
'elt_email' => 'Varchar(100)',
'CARD' => 'Varchar(11)',
'TAXID' => 'Varchar(11)',
'kerngruppe' => 'Varchar(5)',
'PHONE' => 'Varchar(50)',
'PHONE2' => 'Varchar(50)',
'elt_vorname' => 'Varchar(50)',
'elt_nachname' => 'Varchar(60)',
'ADDRESS' => 'Varchar(100)',
'POSTAL' => 'Varchar(5)',
'NAME' => 'Varchar(50)',
'MAXDEBT' => 'Varchar(8)',
'NOTES' => 'Varchar(150)',
'Karte' => 'Date',
'dateiname' => 'Varchar(30)'
);
public function updateMemberFormFields(FieldList $fields) {
$fields->push(new TextField('CURDEBT', 'Guthaben erscheint als Minusbetrag'));
$fields->push(new TextField('username', 'Benutzername'));
$fields->push(new TextField('geburtstag', 'Geburtsdatum'));
$fields->push(new TextField('elt_email', 'Eltern E-Mail'));
$fields->push(new TextField('CARD', 'Kartennummer'));
$fields->push(new TextField('TAXID', 'TAXID'));
$fields->push(new TextField('kerngruppe', 'Kerngruppe'));
$fields->push(new TextField('PHONE', 'Mobil-Telefon Nummer'));
$fields->push(new TextField('PHONE2', 'Festnetz Telefon'));
$fields->push(new TextField('elt_vorname', 'Eltern Vorname'));
$fields->push(new TextField('elt_nachname', 'Eltern Nachname'));
$fields->push(new TextField('ADDRESS', 'Anschrift'));
$fields->push(new TextField('POSTAL', 'Postleitzahl'));
$fields->push(new TextField('NAME', 'Unicenta Name'));
$fields->push(new TextField('MAXDEBT', 'Schueler Kredit'));
$fields->push(new TextField('NOTES', 'Notizen'));
$fields->push(new TextField('Karte', 'Karte ausgestellt'));
$fields->push(new TextField('dateiname', 'Dateiname'));
}
static $has_one = array(
'Image' => 'Image'
);
public function getCMSFields() {
$this->extend('updateCMSFields', $fields);
return $fields;
}
public function updateCMSFields(FieldList $fields) {
$fields->push($imageUpload = new UploadField('Image', 'Mein Foto'));
$imageUpload->setFolderName('Profile');
return $fields;
}
}