Jump to:

5541 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Hide Fields in ModelAdmin generated forms

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

Page: 1
Go to End
Author Topic: 2112 Views
  • pelse
    Avatar
    Community Member
    9 Posts

    Hide Fields in ModelAdmin generated forms Link to this post

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

  • robinp
    Avatar
    Community Member
    33 Posts

    Re: Hide Fields in ModelAdmin generated forms Link to this post

    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

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