5539 Posts in 1738 Topics by 1224 members
|Go to End|
5 March 2014 at 2:27pm
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.
6 March 2014 at 8:07pm
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
6 March 2014 at 8:48pm
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.
|Go to Top|