What's the best way to share settings between multiple modules?

Service Provider
Fra Netherlands
Medlem siden des. 2023

Hi,

I'm developing an add-on that requires the use of a job and two different types of modules. There's a few settings such as an API key and some other things that all of these modules need. I'd rather not duplicate settings between these modules as that's quite cumbersome for users that are installing and configuring these modules.

I did find another topic on the forum that mentions setting groups, but it isn't a super recent discussion (a few years old). What's currently the best way to create a good user experience to configure these settings and allow me to reuse them between modules?

Regards,
NeoDev

tim
Founder
Fra Sweden
Medlem siden mai 2013
tim

You could define the key in includes/config.inc.php

define('VENDOR_API_KEY', '....');

The other option, like you said, is to create a new settings group with settings. See the database tables lc_settings_groups and lc_settings.

I dunno what I would choose. There is a third way, not convenient for modules. But that is vMod Settings.

Du
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.