| Contents at a Glance | 5 |
|---|
| Contents | 7 |
|---|
| Foreword | 25 |
|---|
| About the Author | 26 |
|---|
| About the Technical Reviewer | 27 |
|---|
| Acknowledgments | 28 |
|---|
| Introduction | 29 |
|---|
| How Drupal Works | 30 |
|---|
| What Is Drupal? | 30 |
| Technology Stack | 30 |
| Core | 31 |
| Administrative Interface | 32 |
| Modules | 32 |
| Hooks | 33 |
| Themes | 34 |
| Nodes | 34 |
| Blocks | 35 |
| File Layout | 35 |
| Serving a Request | 37 |
| Summary | 40 |
| Writing a Module | 41 |
|---|
| Creating the Files | 41 |
| Implementing a Hook | 43 |
| Adding Module- Specific Settings | 44 |
| Adding the Data Entry Form | 47 |
| Defining Your Own Administration Section | 55 |
| Presenting a Settings Form to the User | 57 |
| Validating User- Submitted Settings | 59 |
| Storing Settings | 60 |
| Further Steps | 62 |
| Summary | 62 |
| Hooks, Actions, and Triggers | 63 |
|---|
| Understanding Events and Triggers | 63 |
| Understanding Actions | 65 |
| Using the Context in Actions | 75 |
| Examining the Context | 79 |
| How Actions Are Stored | 80 |
| Calling an Action Directly with actions_ do() | 81 |
| Defining Your Own Triggers with hook_ hook_ info() | 82 |
| Adding Triggers to Existing Hooks | 84 |
| Summary | 86 |
| The Menu System | 87 |
|---|
| Callback Mapping | 87 |
| Menu Nesting | 97 |
| Access Control | 98 |
| Title Localization and Customization | 99 |
| Wildcards in Menu Items | 103 |
| Altering Menu Items from Other Modules | 108 |
| Altering Menu Links from Other Modules | 110 |
| Kinds of Menu Items | 110 |
| Common Tasks | 111 |
| Using menu. module | 115 |
| Common Mistakes | 115 |
| Summary | 116 |
| Working with Databases | 117 |
|---|
| Defining Database Parameters | 117 |
| Understanding the Database Abstraction Layer | 117 |
| Connecting to the Database | 119 |
| Performing Simple Queries | 120 |
| Retrieving Query Results | 122 |
| The Schema API | 123 |
| Inserts and Updates with drupal_ write_ record() | 134 |
| Exposing Queries to Other Modules with hook_ db_ rewrite_ sql() | 136 |
| Connecting to Multiple Databases Within Drupal | 139 |
| Using a Temporary Table | 140 |
| Writing Your Own Database Driver | 140 |
| Summary | 141 |
| Working with Users | 143 |
|---|
| The $ user Object | 143 |
| Introduction to hook_ user() | 146 |
| The User Registration Process | 149 |
| The Login Process | 152 |
| External Login | 157 |
| Summary | 164 |
| Working with Nodes | 165 |
|---|
| So What Exactly Is a Node? | 165 |
| Not Everything Is a Node | 168 |
| Creating a Node Module | 168 |
| How Nodes Are Stored | 185 |
| Creating a Node Type with CCK | 186 |
| Restricting Access to Nodes | 187 |
| Summary | 191 |
| The Theme System | 192 |
|---|
| Theme System Components | 192 |
| Installing a Theme | 195 |
| Building a PHPTemplate Theme | 196 |
| Understanding Template Files | 203 |
| Advanced Drupal Theming | 221 |
| Summary | 228 |
| Working with Blocks | 229 |
|---|
| What Is a Block? | 229 |
| Block Configuration Options | 230 |
| Block Placement | 232 |
| Defining a Block | 232 |
| Building a Block | 236 |
| Enabling a Block When a Module Is Installed | 244 |
| Block Visibility Examples | 244 |
| Summary | 245 |
| The Form API | 246 |
|---|
| Understanding Form Processing | 2
|