Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

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.

Customising the CMS /

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

Adding extra fields into member table using Decorator


Go to End


1357 Views

Avatar
lamchau12

Community Member, 4 Posts

1 May 2010 at 7:33pm

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