[development] Best practices: Config settings

Khalid Baheyeldin kb at 2bits.com
Wed Jan 2 03:59:25 UTC 2008

On Jan 1, 2008 6:49 PM, Gerhard Killesreiter <gerhard at killesreiter.de>

> Hi there,
> my question is: Where should contrib module authors put config options
> for their modules?
> 1) Should this always be the individual module's settings page?
> 2) Should it try to add the config option to a more generic place
> (either provided by core or another module it depends on)?
> 3) Should it add it to both places?

What peeves me is that some modules put their settings in the content
type page, while it is just an on/off thing. This way, on a site with 10
content types, and I want to enabled that module's feature for 9 out
of those 10, I have to visit 10 pages, and select from a drop down
and click submit.

The module could simple list all content types under admin/settings/MYMODULE
with a check box next to each. One page to visit, and much better usability.

Also, admin/settings/MYMODULE is the most obvious place to find settings

> 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?
In your specific case, the settings may be in the module's setting page or
performance. But if you decide to do the latter you MUST provide a link in
admin/settings/event to that settings page, so users can find it.
Khalid M. Baheyeldin
2bits.com, Inc.
Drupal optimization, development, customization and consulting.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080101/62976885/attachment-0001.htm 

More information about the development mailing list