18.10.2016 Views

Drupal 7 Module Development

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1<br />

While one could imagine that comments are merely a type of node (and, in fact, there<br />

are modules that do this), <strong>Drupal</strong> developers have chosen to implement comments<br />

as a separate type. The comment module contains the majority of the comment code.<br />

However, again, as with the node system, it provides numerous hooks, and thus<br />

many other modules interact with the comment system.<br />

Fields and entities<br />

In previous versions of <strong>Drupal</strong>, the node system was really the only system for<br />

creating structured pieces of textual content. (Comments are too focused to be<br />

generally useful for extension.) In order to extend node content beyond simple title<br />

and body fields, one needed to either write custom node types or use the Content<br />

Construction Kit (CCK) to build node types.<br />

However, <strong>Drupal</strong> 7 introduces two substantial subsystems that change this:<br />

• The fields system brings most of CCK's functionality into core<br />

• The entities system makes it possible to define other structured data types<br />

that are not nodes<br />

Already these new systems are making waves among <strong>Drupal</strong> developers, with the<br />

<strong>Drupal</strong> Commerce module leading the way in defining sophisticated entities that<br />

are not nodes.<br />

These two subsystems are new, important, and also complex. So we will cover them<br />

in detail in Chapter 6.<br />

Forms API<br />

Another remarkable subsystem that is provided in <strong>Drupal</strong>'s core is the Forms API<br />

(FAPI). This system provides a robust programmatic tool for defining, displaying,<br />

validating, and submitting forms. It takes much of the busy-work out of developing<br />

forms, and also adds a layer of security. FAPI is so integral to <strong>Drupal</strong> that we use it<br />

numerous times throughout the book.<br />

Installation Profiles<br />

More sophisticated <strong>Drupal</strong> use-cases may benefit from the ability to customize the<br />

installation process. <strong>Drupal</strong> provides an installation profile subsystem that can be<br />

leveraged to create a custom installer.<br />

[ 19 ]

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

Saved successfully!

Ooh no, something went wrong!