Book Image

Drupal 7 Module Development

By : Matt Butcher, Larry Garfield, John Wilkins, Matt Farina, Ken Rickard, Greg Dunlap
Book Image

Drupal 7 Module Development

By: Matt Butcher, Larry Garfield, John Wilkins, Matt Farina, Ken Rickard, Greg Dunlap

Overview of this book

<p>Drupal is an award-winning open-source Content Management System. It's a modular system, with an elegant hook-based architecture, and great code. Modules are plugins for Drupal that extend, build or enhance Drupal core functionality.</p> <p>In Drupal 7 Module development book, six professional Drupal developers use a practical, example-based approach to introduce PHP developers to the powerful new Drupal 7 tools, APIs, and strategies for writing custom Drupal code.</p> <p>These tools not only make management and maintenance of websites much easier, but they are also great fun to play around with and amazingly easy to use.<br /><br />If you're eager to learn about these new APIs and start creating modules for Drupal 7, this is your book. Walk through the development of complete Drupal modules with this primer for PHP programmers.</p> <p>From basic modules and themes to sophisticated Drupal extensions, learn how to use Drupal's API and hook system to build powerful custom Drupal websites. With an emphasis on practical programming, this book takes a project-based approach, providing working examples in every chapter<br />Specifically written for Drupal 7, this book will get you coding modules as quickly as possible, and help you add the features that will give your work that professional gloss!<br /><br />This book will walk you through the development of complete Drupal modules and show you how to add various features to meet your requirements.</p> <p>The Drupal content management system, written in the popular PHP language, has skyrocketed in popularity.<br /><br />Developers for this system are in high demand. This book prepares PHP developers for Drupal development, explaining architecture, exploring APIs, and emphasizing practical approaches.</p> <p>In each chapter, readers will learn new aspects of the system while creating fully-functioning modules, themes, and libraries. Learn how to “hook into” any part of the Drupal process, creating custom content types, extending existing capabilities, and integrating with external services and applications.</p>
Table of Contents (22 chapters)
Drupal 7 Module Development
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Bundles


In earlier versions of Drupal only nodes had the ability to have sub-types. In Drupal 7, all entities have the ability to support sub-types. In Drupal parlance, these sub-types are called "bundles".

Note

A bundle is a sub-type of an entity that can be configured separately. Node types are an example of a bundle. Not all entity types have bundles. Users, for instance, do not have separate bundles.

For now, we'll hard-code two bundles, painting and sculpture. In a real use case we'd be likely to also include an administration system to create and manage bundles.