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.

Customising the CMS

Hide Fields in ModelAdmin generated forms


Reply

2 Posts   2124 Views

Avatar
pelse

18 April 2009 at 4:28am Community Member, 9 Posts

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

11 July 2009 at 7:22pm Community Member, 33 Posts

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