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

Hide Fields in ModelAdmin generated forms


Go to End


2 Posts   3995 Views

Avatar
pelse

Community Member, 14 Posts

18 April 2009 at 4:28am

Hi there,

I have extend a new class with the 'ModelAdmin'.
Is there a way to hide or pre define fields in the generated form?

Thanks so far...

Avatar
robinp

Community Member, 33 Posts

11 July 2009 at 7:22pm

Hi,

Just came across this post while looking for something else. If you haven't solve this problem yet here is how I do it.

function getCMSFields() {

$fields = parent::getCMSFields();
$fields->removeByName('Events'); //Removes the Events from the form.

return $fields;
}

Cheers

Robin