Legacy Module Development
Content in this guide
Legacy Module Development
- Module Development for Drupal 726
- Introduction to Module Development for Drupal 7free
- Helpful Tools for Module Development
- An Overview of the Devel Module
- Drupal API Documentationfree
- Anatomy of a Drupal Module
- The Event-Driven Hook System
- Tips for Writing Secure Code
- Overview of the Drupal Menu System
- Using URL Arguments in Page Callback Functions
- Adding Contextual Menu Links and Using Menu Autoloaders
- Using the Drupal Render API
- Attachments and Caching with the Render API
- Altering the Page Array
- Integrating with the Theme System
- An Overview of the Form API
- Creating, Submitting and Validating a Simple Form
- Organizing Collections of Form Elements
- Creating Dynamic Forms with the States System
- Altering Forms with hook_form_alter()
- Altering Specific Forms and Customizing Validation
- Creating a Configuration Settings Form for Your Module
- An Overview of the Database Layer in Drupal 7
- Querying the Database with db_select()
- Adding a Table to the Database
- Querying the Database with Query Methods
- Altering the Database
- Working with Entities in Drupal 716
- Introduction to Working with Entities in Drupal 7 Seriesfree
- What Are Drupal Entities?free
- Work with Existing Drupal Entities
- Make Lists of Entities with Entity Field Query
- Our Custom Drupal Entity Use Case
- Create a Simple Custom Entity
- Introduction to Entity Classes
- Provide an Admin UI for Your Entity
- Override the Entity Controller for Better Rendering and Saving
- Make Your Entity Fieldable with Bundles
- Entity View Modes
- Expose Your Entity to Views
- Customize the Entity UI by Overriding the UI Controller
- Better Entity Property Information
- Using Entity Metadata Wrappers
- Entity Revisions
- Drupal 7 Field API: Creating Custom Field Types, Widgets and Formatters12
- Introduction to the Drupal 7 Field API Seriesfree
- Drupal 7 Field API Fundamentals
- Field API Documentation and Resources
- Define What We're Building & Start a New Module
- Providing Drupal with Meta-Data About a Custom Field
- Defining a Field's Schema for Database Storage
- Creating Field Widgets For Collecting User Inputfree
- Validating and Saving Field Data
- Adding Settings for Field Widgets
- Creating a Field Formatter and Displaying Field Data
- Adding Additional Settings for Field Formatters
- Performing Additional Operations When Loading Field Data
- Coding for Views for Drupal 718
- Introduction to Coding for Viewsfree
- Setting up Your Local Environment
- Finding Additional Views Help and Resources
- Telling Views About Your Modulefree
- Creating a Default View by Exporting an Existing View
- Re-Introducing the Databasics Module
- Exposing Your Module's Tables to Views
- Exposing Your Module's Tables to Views Continued...
- Exposing More Fields and Adding Relationships
- Writing Custom Field Handlers
- Writing Custom Field Handlers Continued...
- Adding Fields That Do Not Exist in the Database
- Writing Custom Filter Handlers
- Writing Custom Sort Handlers
- Writing Custom Area Handlers
- Databasics Default View
- Views Access Plugin
- Theming Views
- Automated Testing in Drupal 7 with SimpleTest13
- Introduction to Automated Testing with SimpleTestfree
- What Is Automated Testing?
- Understanding SimpleTest's Terminology and Methodology
- Installing SimpleTest and Running Tests
- Learning Test Case Basics by Writing a Hello World Testfree
- Different Types Of Assertions in SimpleTest
- Navigating a Site with SimpleTest's Browser
- Testing and Submitting Forms with SimpleTest
- Handling Users and Permissions in SimpleTest
- Creating Dummy Content with SimpleTestfree
- Uploading Files and Submitting AJAX Forms with SimpleTest
- Writing Unit Tests Using DrupalUnitTestCase
- Testing an Existing Site with SimpleTest 2.x
- Building Web Services with Drupal 717
- Introduction to Building Services with Drupal 7 Seriesfree
- What are Web Services?free
- Installing the Services Module
- What Is REST?
- Adding an Endpoint
- Enabling Resources
- Testing Resources with cURL
- Testing Resources with the Chrome REST Console Plugin
- Using Parameters and Arguments with Resources
- Altering the Response Object
- Configuring Services for Authenticated Requests
- Making Authenticated Requests with cURL
- Making Authenticated Requests with the REST Console
- Using Views with Services
- Services and Views Filters
- Writing a Custom Services Resource
- Documenting Your API
- Drupal 7 Token API7
- jQuery and JavaScript in Drupal 7 Series14
- Introduction to jQuery and JavaScript in Drupalfree
- jQuery Overviewfree
- Adding JavaScript Through a Theme
- The jQuery Macro Maker Demonstration Module
- Adding JavaScript and Variables Through a Module
- Drupal.behaviors and Drupal-Specific JavaScript
- Making Tables Sortable with jQuery
- JavaScript-Related Form Api Properties
- Dynamic Forms in Drupal 6: Ahah Framework
- Ajax Framework in Drupal 7
- Creating Ajax-Enabled Links in Drupal 7
- JavaScript Form Dependencies with the States System
- JavaScript-Related Drupal Contrib Modules
- jQuery and JavaScript in Drupal Review
- Introduction to jQuery Series13
- Introduction to jQueryfree
- What Is jQuery?free
- Introduction to Firebug
- Overview of jQuery Concepts
- Using jQuery Selectors
- jQuery Effects and Animations
- jQuery Events
- Adding jQuery Scripts
- DOM Manipulation with jQuery
- DOM Traversing with jQuery
- Implementing AJAX with jQuery
- Using jQuery Plugins
- Introduction to jQuery Review
- Coding for Rules9
- Coding for Rules Overviewfree
- Creating a Rules Actionfree
- Adding Rules Action Parametersfree
- Additional Rules Action Settingsfree
- Providing New Parameters for Rulesfree
- Declaring Conditions for Rulesfree
- Declaring Events for Rulesfree
- Invoking Rules Eventsfree
- Miscellaneous Tips When Coding for Rulesfree
- Importing Data with Migrate and Drupal 718
- Introduction to the Migrate Module Seriesfree
- Migrate Module Overviewfree
- Install and Tour Migrate Module
- Run Migrations with the Migrate UI
- Run Migrations with Drush
- Review the Migrate Example Modules
- Set up Migrate Demo Site and Source Data
- Preparing Your Environment to Run Migrations
- Write a Simple Migration Class
- Migrate Field Mappings
- Use Preparerow to Perform Extra Operations
- Adding Additional Metadata to a Migration
- Using Sourcemigrations to Add Related Data
- Map Multi-Value Fields with the Separator Method
- Create Migrate Stubs
- Migrate Source Classes
- Migrate Destination Classes
- Strategies for Resolving Migrate Failures
Ready to learn modern Drupal module development? Drupal Module Developer Guide
What will you learn
- Coding and development in Drupal 7
- Using hooks in Drupal 7
- Render API in Drupal 7
- Menu system in Drupal 7
- Coding for Views in Drupal 7
- Working with entities and fields in Drupal 7 modules
Overview
This is a guide to our legacy module development tutorial content which was produced for Drupal 7.
Drupal 7 for Developers
Background and prerequisites
Coding
PHP: Hypertext Preprocessor (PHP) is a popular interpreted programming language that is especially suited for web development. Drupal core and all contributed modules are written in PHP.
JavaScript files are included by a module or a theme by creating an asset library. Using this asset library system you can selectively choose which files to load, overwrite existing files, or customize them to suit your needs.
Coding standards provide a set of rules for how your code should be formatted, and best practice guidelines for naming conventions and the location of files.
Local development set up and tools
Developers are expected to know how to work on a copy of the live site, instead of making potentially hazardous changes or testing new ideas directly on the live site. You should be able to set up a development environment for your work.
Development environments provide a sandbox where you can work on your application without affecting the live site.
Essential lessons
Advanced concepts
Tools and workflows for deploying code and configuration changes from one environment to another with Drupal-specific considerations.