We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Best way to store settings for custom module?

Development and Programming

Adrian Macneil (Crescendo)'s avatar
Adrian Macneil (Crescendo)
28 posts
15 years ago
Adrian Macneil (Crescendo)'s avatar Adrian Macneil (Crescendo)

I’m developing a couple of modules. Does EE have any way to allow third party modules to store settings, other than creating a separate db table? (which feels wrong, especially given ‘extensions’ are allowed to store custom settings!)

       
hd 's avatar
hd 
156 posts
15 years ago
hd 's avatar hd 

This depends on the type of add-on. Some allow saving custom settings very easily. There are some examples in the user docs, but you may find better examples by downloading a couple add-ons (of the same type you are trying to create) from devot-ee, and see how they handle it (there are a couple approaches).

       
Adrian Macneil's avatar
Adrian Macneil
21 posts
15 years ago
Adrian Macneil's avatar Adrian Macneil

Thanks hd. As I mentioned the type of add-on is a ‘module’, although it seems pointless how EE differentiates between different types of addons.

I see that extensions have a nice automatic way to store settings, so I was wondering whether I was missing something with modules, as I have resorted to creating a separate database table.

       
ender's avatar
ender
1,644 posts
15 years ago
ender's avatar ender

I believe it is DevDemon’s “Tagger” module that creates a column in the exp_modules table for settings (if it doesn’t already exist) with a comment in the code to the effect of “why isn’t this already here?”. If many add-on developers decide to create and use the same column in that table maybe we can get ellislab to include it in a future EE2 release. Might have a look at what they do since it’s a free module.

       
Adrian Macneil (Crescendo)'s avatar
Adrian Macneil (Crescendo)
28 posts
15 years ago
Adrian Macneil (Crescendo)'s avatar Adrian Macneil (Crescendo)

Thanks ender, that sounds like a smart idea. It seems like something fairly obvious was overlooked not allowing modules to store settings. I’ll go with modifying the exp_modules table, and hopefully ellislab test for an existing column before trying to add it in any schema updates they do in future!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.