HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
“Even if you’re already a seasoned Drupal user of CCK, Views, or Panels, I’ve no doubt that this book will provide you with several new techniques and methods for getting the most out of these extremely essential modules. It certainly has for me.”
—Dries Buytaert, founder and project lead of Drupal, and CTO of Acquia
With Drupal, Web professionals can create full-featured Web sites with just a few clicks. Drupal’s core is compact and well documented, but much of Drupal’s immense power lies elsewhere—in external modules. Drupal’s Building Blocks is an authoritative tutorial, reference, and cookbook for Drupal’s most valuable modules.
The authors are Drupal insiders who’ve spent years creating and supporting these modules—Earl Miles, developer of the Views and Panels modules, and Lynette Miles, Drupal documentation team member. They’ve brought together indispensable information you won’t find anywhere else, as well as extensive sample “recipe” code designed for easy adaptation and reuse. Learn how to
This book will help you create more powerful, flexible, usable, and manageable Web sites—whether you’re a Web developer, designer, administrator, architect, or consultant.
The accompanying Web site contains all examples, code, and themes presented in this book.
Drupal's Building Blocks: Creating Views
Download the sample pages (includes Chapter 7 and Index)
Foreword xvii
Preface xix
Acknowledgments xxiii
About the Authors xxiv
Part I: Content Construction Kit
Chapter 1: Introducing CCK and Nodes 3
The Node System 3
Quest for the Grail: How CCK Was Born 8
Getting Started with CCK 10
Creating a New Content Type 11
Summary 15
Chapter 2: Field Concepts 17
What You Should Know Before Creating Fields and Content Types 17
The Content Type Pages 17
Creating New Fields for Content 24
Putting the Parts Together 30
Summary 38
Chapter 3: Deeper into Fields 39
Choosing Field Types 39
Constraining Data with Widgets 43
Date Module 48
Computed Fields 51
Link and Email Fields 54
Highly Visual Media 55
Summary 57
Chapter 4: Themes and CCK 59
Theme Basics 59
CCK Specific Theming 62
Helper Modules 69
Summary 73
Chapter 5: CCK API 75
Using the CCK API 75
The Field Model 76
Widget Type Modules 85
Formatter Modules 87
Creating Field Instances Using Content Copy 91
Creating Field Instances with the CRUD API 91
Creating Data for CCK Fields 95
Miscellaneous Helper Functions 97
Summary 98
Part II: Views
Chapter 6: Relational Databases 101
Drupal, SQL, and the Emergence of Views 101
The Basics of Relational Databases 102
Filtering and Sorting 105
From SQL to Views to Human Language 107
Summary 108
Chapter 7: Creating Views 109
Views UI 109
Showing Your Views to the World: Creating Displays 131
Summary 136
Chapter 8: Arguments, Exposed Filters, and Relationships 137
Arguments 137
Exposed Filters 145
Relationships 148
Summary 151
Chapter 9: Theming Views 153
An Overview 153
Classes in Views 153
Template Files 156
Working with Templates 164
Summary 175
Chapter 10: Query Optimization 177
Balancing Development Time against CPU Time 177
Sticking with What Views Gives You 177
When You Need More Than Views 178
Experimenting with Your Site 183
Summary 183
Chapter 11: Views API 185
Data Architecture 185
The Views API 199
The Life Cycle of a View 201
The Database Schema and Data Hook 206
Handlers Versus Plugins 210
Summary 213
Part III: Panels
Chapter 12: Introducing Panels 217
Introduction to Panels 217
Modules 222
Summary 224
Chapter 13: Creating Panels 225
Your First Panel 225
Adding Content to Panels 237
Access Rules 244
Overriding Core Display Pages 246
Overriding Core Node Editing Pages 253
Summary 255
Chapter 14: Contexts, Relationships, and Arguments in Panels 257
Contexts 257
Arguments in Panes 264
Relationships 271
Summary 274
Chapter 15: Panels Theming 275
Layout 275
Stylizer 280
CSS in the Panels UI 284
CSS in Source Code 285
Summary 290
Chapter 16: Site Deployment 291
Configuring Your Development Environment 291
Moving to Production 293
Exporting Your Structures 294
Helper Modules 299
Summary 300
Part IV: Appendices
Appendix A: Other Useful Modules 303
Extending the Use of Your Modules 303
General Modules 303
Views 304
CCK 307
Panels 308
Appendix B: Reporting Issues 309
Submit a Complete Report 309
Read the Documentation 310
Check Other Sources 311
Know the Difference between a Bug and a Support Request 312
Stay on Topic 312
Understand the Life Cycle of a Bug 312
Be Patient 313
Remember That You’re Asking for Someone Else’s Time 314
Contribute Back 314
Appendix C: Views API Handlers and Plugins 315
Views Handlers 315
Views Plugins 317
Views Classes 318
Index 327