18.10.2016 Views

Drupal 7 Module Development

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 12<br />

Profile modules and themes<br />

While modules and profiles can be stored in the /sites/all folder, as described in<br />

Chapter 2, modules and themes bundled with a profile have a special place where they<br />

can reside. In the profile they may have their own modules and themes directories:<br />

Storing the modules and themes within the profile enables distributions to be<br />

packaged together in one part of <strong>Drupal</strong>, and allows the standard module and<br />

theme overriding system to work.<br />

Since modules and themes can be stored in more than one place<br />

there is an order to how <strong>Drupal</strong> chooses which source to use for a<br />

module. <strong>Module</strong>s and themes in the /sites/all folder are chosen<br />

over those in the profile folder, and modules and themes in a site<br />

specific folder are chosen over those in the /site/all folder.<br />

<strong>Drupal</strong>.org Bundled Distributions<br />

The drupal.org packaging system is capable of taking an<br />

installation profile with some additional configuration and<br />

creating a downloadable distribution. Details are available at<br />

http://drupal.org/node/642116.<br />

Creating profiles<br />

Profiles consist of a .info file and a .profile (pronounced "dot-profile") file. This is<br />

similar to how modules are structured, as described in Chapter 2.<br />

The .info file for a profile looks just like a .info file for a module and contains the<br />

same information.<br />

name = Example Store<br />

description = "An example store installation profile."<br />

version = VERSION<br />

core = 7.x<br />

files[] = store.profile<br />

files[] = store.install.inc<br />

files[] = store.install<br />

[ 345 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!