Programmer's Guide to Drupal. Principles, Practices, and Pitfalls. 2nd Edition - Helion
ISBN: 978-14-919-1262-1
stron: 238, Format: ebook
Data wydania: 2015-10-13
Księgarnia: Helion
Cena książki: 92,65 zł (poprzednio: 107,73 zł)
Oszczędzasz: 14% (-15,08 zł)
If you’re a web programmer, your experiences have taught you certain lessons—and only some of them apply well to Drupal. Drupal has its own set of programming principles that require a different approach, and many programmers make mistakes when relying on skills they’ve used for other projects. This book will show you which programming techniques you can use—and which you should avoid—when building web applications with this popular content management framework.
Updated to cover both Drupal 7 and Drupal 8, the guidelines in this book demonstrate which programming practices conform to the "Drupal way" and which don’t. The book also serves as an excellent guide for Drupal 7 programmers looking to make the transition to Drupal 8.
- Get an overview of Drupal, including Drupal core and add-on modules and themes
- Learn Drupal’s basic programming principles, such as the ability to customize behavior and output with hooks
- Compare Drupal 7 and Drupal 8 programming methods, APIs, and concepts
- Discover common Drupal programming mistakes—and why hacking is one of them
- Explore specific areas where you can put your programming skills to work
- Learn about the new object-oriented Drupal 8 API, including plugins and services
Osoby które kupowały "Programmer's Guide to Drupal. Principles, Practices, and Pitfalls. 2nd Edition", wybierały także:
- Drupal 9 Module Development 157,37 zł, (29,90 zł -81%)
- Drupal 7. Kurs video. Poziom drugi. Zaawansowane moduły, skórki i patche 69,00 zł, (31,05 zł -55%)
- Drupal 7. Kurs video. Poziom pierwszy. Szybkie tworzenie stron internetowych 69,00 zł, (31,05 zł -55%)
- Drupal 7. Od podstaw 44,11 zł, (24,70 zł -44%)
- Drupal. Poznaj go z każdej strony 67,77 zł, (37,95 zł -44%)
Spis treści
Programmer's Guide to Drupal. Principles, Practices, and Pitfalls. 2nd Edition eBook -- spis treści
- Preface
- Intended Audience
- How to Use This Book
- Drupal Versions
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgments
- 1. Overview of Drupal
- What Is Drupal?
- Drupal Core
- Drupal Add-Ons: Modules, Themes, Distributions, and Translations
- Finding Drupal add-ons
- The Evolution of Drupal
- How Drupal Handles HTTP Requests
- HTTP Request Handling in Drupal 7
- HTTP Request Handling in Drupal 8
- The Drupal Cache
- Drupal 7 Cache API
- Drupal 8 Cache API
- Automatic Class Loading in Drupal
- What Is Drupal?
- 2. Drupal Programming Principles
- Principle: Drupal Is Alterable
- Setting Up a Module or Theme
- Where to put modules and themes
- Creating a sub-theme
- The Basics of Module and Theme Hook Programming
- Making Your Module Output Themeable
- The Basics of Drupal 8 Plugin Programming
- Defining a plugin type
- Creating a plugin manager
- Implementing a plugin in a module
- Drupal 8 Services and Dependency Injection
- Basic concepts: Services, Containers, and Dependency Injection
- Defining a service
- Service tags
- Overriding services
- Rebuilding the container
- Interacting with the Drupal 8 Event System
- Setting Up a Module or Theme
- Principle: Drupal Separates Content, Configuration, and State Data
- Information Storage in Drupal 7
- Information Separation in Drupal 8
- Configuration API in Drupal 8
- Configuration file format and schema in Drupal 8
- Simple configuration API in Drupal 8
- Configuration entities in Drupal 8
- Configuration overrides in Drupal 8
- State API in Drupal 8
- Principle: Drupal Is International
- Internationalizing User Interface Text
- Internationalizing User-Entered Text in Drupal 7
- Internationalizing User-Entered Text in Drupal 8
- Principle: Drupal Is Accessible and Usable
- Principle: Drupal Is Database-Independent
- Setting Up Database Tables: Schema API and hook_update_N()
- Querying the Database with the Database API
- Very simple queries
- Dynamic queries
- Principle: Drupal Is Secure; User Input Is Insecure
- Cleansing and Checking User-Provided Input
- Checking Drupal Permissions
- Drupal cores main permission system
- Permissions and security in forms
- Permissions in displaying and operating on content
- Principle: Drupal Code Is Tested and Documented
- Principle: Drupal Is Alterable
- 3. Common Drupal Programming Mistakes
- Mistake: Programming Too Much
- Avoiding Custom Programming with Fielded Data
- Defining Theme Regions for Block Placement
- Mistake: Overexecuting Code
- Mistake: Executing Code on Every Page Load
- Mistake: Using an Overly General Hook
- Mistake: Saving PHP Code in the Database
- Mistake: Working Alone
- Participating in Groups and IRC
- Reporting Issues and Contributing Code to the Drupal Community
- Contributing to the Drupal Community in Other Ways
- Mistake: Programming Too Much
- 4. Drupal Programming Examples
- Registering for URLs and Displaying Content
- Registering for a URL in Drupal 7
- Altering a URL Registration in Drupal 7
- Registering for a URL in Drupal 8
- Providing Administrative Links
- Altering Routes and Providing Dynamic Routes in Drupal 8
- Registering a Block in Drupal 7
- Registering a Block in Drupal 8
- Creating Render Arrays for Page and Block Output
- Render Arrays in Drupal 8
- Generating Paged Output
- Using the Drupal Form API
- Form Arrays, Form State Arrays, and Form State Objects
- Basic Form Generation and Processing in Drupal 7
- Basic Form Generation and Processing in Drupal 8
- Creating Confirmation Forms
- Adding Autocomplete to Forms
- Altering Forms
- Programming with Ajax in Drupal
- Setting Up a Form for Ajax
- Wrapper-Based Ajax Callback Functions
- Command-Based Ajax Callback Functions in Drupal 7
- Command-Based Ajax Callback Functions in Drupal 8
- Programming with Entities and Fields
- Terminology of Entities and Fields
- Defining an Entity Type in Drupal 7
- Step 1: Implement hook_entity_info()
- Step 2: Implement hook_schema()
- Step 3: Add predefined fields in hook_install()
- Step 4: Set up display
- Step 5: Set up editing and management
- Step 6: Enable your module
- Defining a Content Entity Type in Drupal 8
- Step 1: Define the entity interface and class
- Step 2: Define handlers
- Step 3: Set up routing and links
- Step 4: Add Views integration
- Step 5: Enable your module
- Defining a Configuration Entity Type in Drupal 8
- Step 1: Define the configuration schema
- Step 2: Define the entity interface and class
- Step 3: Define handlers
- Step 4: Define routing and route controllers
- Step 5: Enable your module
- Querying and Loading Entities in Drupal 8
- Defining a Field Type
- Defining a field type in Drupal 7
- Defining a field type in Drupal 8
- Programming with Field Widgets
- Defining a field widget in Drupal 7
- Defining a field widget in Drupal 8
- Repurposing an existing field widget
- Programming with Field Formatters
- Defining a field formatter in Drupal 7
- Defining a field formatter in Drupal 8
- Creating Views Module Add-Ons
- Views Programming Terminology and Output Construction
- Setting Up Your Module for Views in Drupal 7
- Providing a New Views Data Source
- Adding Handlers to Views
- Adding Fields and Relationships to an Existing Views Data Source
- Providing a Style or Row Plugin to Views
- Providing Default Views
- Creating Rules Module Add-Ons in Drupal 7
- Providing Custom Actions to Rules
- Providing Default Reaction Rules and Components
- Programming with CTools in Drupal 7
- Implementing CTools Plugins for Panels
- Determining plugin background information
- Notifying CTools about plugin implementations
- Writing the plugin implementation code
- Providing Default CTools Exportables
- Implementing CTools Plugins for Panels
- Registering for URLs and Displaying Content
- 5. Programming Tools and Tips
- Where to Find More Information
- Drupal Site Building and General Drupal Information
- Drupal Programming Reference and Background
- Using api.drupal.org
- PHP Resources
- Database Resources
- Other Web Technology Resources
- Drupal Development Tools
- Discovering Drupal API Functions and Classes
- Other Programming Tips and Suggestions
- Where to Find More Information
- Index