[keyword] contributed modules

Drupal7: on splitting module code into separate .inc include files

HOT TIP: this content is flagged as highly recommended !

Some key points about use of .inc files with Drupal7

Example of loading include file in same folder as the .module:

./includes/language.inc: *   module_load_include('language', 'inc', 'language.negotiation');
./includes/module.inc: *   module_load_include('inc', 'node', 'node.admin');
./includes/module.inc: *   module_load_include('inc', 'node', 'content_types');

Example of loading include file in a subfolder includes:

[antipattern] Not invented here

Wikipedia quotes

In programming, it is also common to refer to the NIH "Syndrome" as the tendency towards reinventing the wheel (reimplementing something that is already available) based on the belief that in-house developments are inherently better suited, more secure or more controlled than existing implementations.


Source: Not invented here Version date: 2014-02-19

Far too often, Drupal shops and Digital Media Agencies insist on reinventing the wheel by developing in-house contributed modules, either because they have "Not Invented Here" syndrome, or because they have not taken the time to do proper technology assessment of the (as of Feb 2014) over 14,000 contributed Drupal modules !

Drupal module development

This zone is not a complete guide to Drupal7 module development, it is mostly just a collection of links to useful existing material; you should in any case also inspect all of the examples under the Main Drupal7 API reference examples demonstrating the use of the main hooks.

Subscribe to RSS - contributed modules