Question

I'm creating a module for silverstripe where webapp settings can be configured and where app icons/splash screens can be uploaded. To do this i have used the model admin to manage two DataObjects containing the icons/splash screens. This works great.

But now i have some extra fields i would like to manage from the same admin panel ('app title', 'Fullscreen app', 'statusbar' & 'minimal UI'). it would be great if it is possible to add an extra tab to the model admin where i can add these fields, problem is:

  • how do i save these values
  • how do i create this extra tab

i also see possibilities in extending LeftAndMain for this, but then i lose the dataobject management capabilities of the ModelAdmin.

Any tips help would be much appreciated!

Was it helpful?

Solution

The extra tabs in ModelAdmin are for administrating models - hence the name! The best way to strictly meet your needs within the grounds of the framework would be to have a "AppConfig" object that encapsulates your app's settings, and manage it within that ModelAdmin. Set up relationships in your other models to refer to these settings.

private static $managed_models = array(/*other models*/, 'AppConfig');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top