0

I have inherited a site that makes use of a bespoke extension that has a long list of settings (https://docs.expressionengine.com/latest/development/extensions.html#abstracted-settings-form-and-processing).

The site is becoming an MSM one so i need to create site specific settings. Does EE handle this or do i need to build MSM support into the extension? Cant seem to find anything in the docs.

1 Answer 1

1

Nope, the extension settings are for the entire control panel across all MSM sites by default (no site_id references). You will have to build in your own site_id references into the setting storage. You can store the settings as a multi-dimensional array, so use the numerical parent array as the site_id reference? You will probably have to use your own view file to display the settings page though and ensure the array structure is retained.

Edit: Further thought, you won't need to use your own view file, as you can send only the required site settings to the default view (return of function), therefore using the default, just ensure you capture the save settings to place it into the appropriate multi-dimensional array element.

4
  • So basically, i can no longer use the quicker abstract way and instead create my own form etc.
    – BillyMedia
    Mar 7, 2016 at 9:40
  • If your settings are specific to each MSM site, then default settings for either modules, fieldtypes or extensions aren't specific to each site as they don't have a site_id column in the database. So yes, you'll have to build your own. Just checked the DB on both EE2 and EE3 and they are the same - no ability to identify site_id. Mar 7, 2016 at 10:05
  • Cheers Peter. I am a little surprised that this isn't already baked in as I can imagine it would be a trivial task to have MSM support. i.e. have it save settings in a muilti-dim array from the off.
    – BillyMedia
    Mar 7, 2016 at 10:51
  • Have edited answer, as realised you can get away with the default "settings" function, as long as you catch the return in the save_settings function. Mar 7, 2016 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.