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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

How to create a singleton admin form?


Go to End


2 Posts   1141 Views

Avatar
jcop007

Community Member, 7 Posts

30 January 2015 at 4:38pm

Hi
How would you create a singleton admin form where you only ever want one record in the database? In our case we have created a custom module that requires a settings form. The settings are currently set up as a model admin but that gives you a grid for adding/editing multiple records in admin. Ideally we'd like it to work like the standard SilverStripe settings which just open the settings form directly.
Thanks,
Jonathan

Avatar
kinglozzer

Community Member, 187 Posts

31 January 2015 at 5:23am

Hi Jonathan,

I’d use the SiteConfig code to guide you. It’s been broken apart into a separate module for the future 3.2 release, so it’s a bit easier to review all the code for it now: https://github.com/silverstripe/silverstripe-siteconfig.

Hope this helps,
Loz