In the course of developing our site, we will frequently come across situations where various elements of the site need to be tweaked in PHP using Drupal's APIs. While a lot of theme-specific cases can be stored in template files, certain tweaks which are theme-agnostic require that we store them in a module to ensure that they are available to all themes.
This recipe covers the creation of a module to hold all these bits and pieces.
Create a folder inside sites/all
named modules
. This is where custom and contributed modules are usually housed.
The following list details the procedure involved in creating a module named mysite
to hold our theme-agnostic customizations and other odds and ends:
Create a folder inside
sites/all/modules
namedmysite
where mysite refers to the name of our site.Create a file named
mysite.info
within themysite
folder.Edit this file and add the following code inside:
name = Mysite description...