Jump to:

5541 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » ModelAdmin without a DataObject - Static page

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

Page: 1
Go to End
Author Topic: 315 Views
  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    ModelAdmin without a DataObject - Static page Link to this post

    SS 3.1

    I have need for a section in the the CMS admin where one tab is a GridField for a DataObject, but the other is a small form (one field, one button) linked to nothing. The action on the form will be completely custom and external to Silverstripe.

    The DataObject is fine as per documentation, but how do I add a tab to this ModelAdmin that contains nothing more than static HTML?

    I've downloaded both the Dashboard and SwipeStripe modules to get some guidance, but I can't decipher the structure in either.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: ModelAdmin without a DataObject - Static page Link to this post

    ModelAdmin is designed for managing your DataObjects, if you want to push additional fields into an existing ModelAdmin you can override getEditForm() in your ModelAdmin subclass to provide additional buttons etc. If you just want a generic panel in the admin you can manage, subclass 'LeftAndMain'. An overview is available at http://doc.silverstripe.org/framework/en/reference/cms-architecture

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: ModelAdmin without a DataObject - Static page Link to this post

    Thanks again Will,

    Since posting I've started playing with the second option, LeftAndMain, loosely based on the default SiteAdmin -> SiteConfig relationship and overriding getCMSFields as per SiteConfig.

    Limited success so far. I have a manual form displaying, and a dataObject form displaying (the later I plan to replace with a read-only GridField). But they're all on one page instead of split over two tabs as I have defined.

    Actually I think they really are split, but the tabs are just links sitting in the top right corner. E.G. I'm missing some JS for handling the tabs.

    Will continue in the morn and post my code for future ref on success. There's not much specifically for this sort of thing out there.

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