[development] Best practices: Config settings

Earnie Boyd earnie at users.sourceforge.net
Wed Jan 2 15:27:04 UTC 2008


Quoting Gerhard Killesreiter <gerhard at killesreiter.de>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi there,
>
> my question is: Where should contrib module authors put config options
> for their modules?
>

A very good question.  With 5.x, after installing a contrib module, I 
usually check admin/by-module for the settings of the module.  I find 
it much easier to find if there are any I need to consider.

> 1) Should this always be the individual module's settings page?
>

This is what I would look for.

> 2) Should it try to add the config option to a more generic place
> (either provided by core or another module it depends on)?
>

I would not tend to look here.

> 3) Should it add it to both places?
>

Perhaps.

> Concrete example:
>
> I've added a performance related variable to event module. The value of
> the variable decides whether to do a full node load for each event on a
> calendar or to only use title, start, and end date from one mysql query.
>
> Now I need to put the UI for this variable somewhere...
>
> The variable also has influence on the theme you use since you can't
> print out any other node content fields if they aren't there. The event
> functions that event.module ships with for example expect the presence
> of a teaser field.
>
> In principle, I think that the variable should be set at
> admin/settings/performance but who is going to look there again after
> each newly installed module?
>

Probably not many would think to look on initial configuration of the 
module.  I would look for the settings for the specific module and not 
for a modification to an existing module or core settings page.

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/



More information about the development mailing list