Download the PHP package jonom/silverstripe-someconfig without Composer
On this page you can find all versions of the php package jonom/silverstripe-someconfig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jonom/silverstripe-someconfig
More information about jonom/silverstripe-someconfig
Files in jonom/silverstripe-someconfig
Package silverstripe-someconfig
Short Description Combines the CRUD features of ModelAdmin with the singleton settings editing of SiteConfig so content and settings can be co-located.
License BSD-3-Clause
Informations about the package silverstripe-someconfig
Silverstripe SomeConfig
If 🗂️ ModelAdmin
and ⚙️ SiteConfig
had a baby, what would you get? This module! 🐣
What is this for
SiteConfig
is great for storing site wide settings. ModelAdmin
is great for viewing data. But you know what? Sometimes you want to co-locate related data and settings.
SomeConfig
combines the CRUD features of ModelAdmin
with the singleton settings editing of SiteConfig
, so content and related settings can live together.
Example:
Say you have a contact form on every page of your site, and you have a ModelAdmin
instance to let CMS users browse submissions. That contact form sends an email to someone, so you added an EnquiryMailTo
field to SiteConfig
for that. Now users have to go to two different places to manage content related to your enquiry form. Wouldn't it be nice if it was all under /admin/enquiries/
?
Requirements
SilverStripe ^4 | ^5
Installation
How to use
-
Apply the
SomeConfig
trait to aDataObject
class that contains your settings fields.- Like
SiteConfig
, only one of these objects will be allowed to exist per site.
- Like
-
Apply the
SomeConfigAdmin
trait to aModelAdmin
sub-class that includes your config class.- Limitation: your config class can't be first. At this time this module is pretty simple. It just changes the tab and back links so you don't see the gridfield for your settings object. That trick doesn't work though if your settings class is the first tab as the gridfield view will be loaded when you access the admin.
-
If you want to access config settings in templates, make sure your config class implements
TemplateGlobalProvider
. Then use it likeSiteConfig
. - You can access config objects in php code like:
Maintainer contact
Sponsorship
If you want to boost morale of the maintainer you're welcome to make a small monthly donation through GitHub, or a one time donation through PayPal. ❤️ Thank you!
Please also feel free to get in touch if you want to hire the maintainer to develop a new feature, or discuss another opportunity.