Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Adding extra fields into member table using Decorator

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

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

    Adding extra fields into member table using Decorator Link to this post

    Hi all,

    I'm using decorator to add some extra fields into member table.
    But after adding, in Securities tab, my extra fields are only displayed when clicking on "Edit" button.
    I don't want that, i need to display my extra field in the list, please refer to image : http://easycaptures.com/1707219429

    Below is my current code :

    <?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{
    }
    ?>

    855 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.