Jump to:

5451 Posts in 1673 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Changes member's field in Security tab ( Decorator object )

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

Page: 1
Go to End
Author Topic: 916 Views
  • lamchau12
    Avatar
    Community Member
    4 Posts

    Changes member's field in Security tab ( Decorator object ) Link to this post

    Hi all,

    I'm using decorator object to add one extra field ( AvatarURL field ) to member table.
    In the Security tab, we have four fields : FirstName, Surname, Email, Password.
    When clicking on "Add" button, we will see some fields. In those fields, there is my extra field ( AvatarURL field).

    I want to display my extra field ( AvatarURL field ) with four fields. That means on the table, i will have FirstName, Surname, Email, Password, AvatarURL. HOW COULD I DO THAT ?

    Below is my code of decorator class :

    <?php
    class Deelnemers extends DataObjectDecorator {
       function extraStatics() {
          return array(
             'db' => array(
                'AvatarURL' => 'Varchar',
             ),
             'has_one' => array(
                'RelatedMember' => 'Member',
             ),
          );
       }
       
       function updateCMSFields(FieldSet $fields){
          $fields->push(new TextField('AvatarURL','Enter AvatarURL'));
       }
    }

    class Deelnemers_Controller extends Page_Controller{
       
    }
       

    ?>

    916 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.