Before you dive into using coding standards it makes sense to understand exactly what they are and why they’re important, generally and specifically in the Drupal community. In this tutorial we will look at:
- What coding standards are
- Why following coding standards is a good idea
- Where coding standards come from
By the end of this tutorial you'll have a better understanding of what coding standards are, and why you should be adhering to them when you write code.
Patches are used to describe modifications made to one or more code files, and can be used to share those changes.
Entities are the fundamental building blocks that make up any Drupal site. Having a good understanding of the Entity system is an important part of ensuring the data model of your Drupal site is set up properly.
Modules are bundles of primarily PHP code that extend Drupal in order to add new features or alter existing functionality.
Installing Drupal using the instructions in this tutorial will give you a working Drupal site that can be used for learning, or real-world project development.
Before you can work on a Drupal site locally (on your computer), you'll need to set up a local development environment. This includes all the system requirements like PHP and a web server, that Drupal needs in order to run. Our favorite way to accomplish this is using DDEV.
In this tutorial we'll learn:
- How to install and configure DDEV for use with a Drupal project.
- How to use DDEV's integrated Composer to download Drupal and Drush.
- How to install Drupal inside DDEV so you can access the site and start doing development.
By the end of this tutorial, you should be able to set up a local development environment for learning Drupal or working on a new Drupal project.
Create a custom module and alter the content on a node page using a hook and existing theme functions.
Identify and use preprocessors by creating a custom breadcrumb trail on a page, and reduce and refactor code in custom modules.
Create a new module for movie imports, which will display a form when the user navigates to a page.
Make SQL queries in Drupal, make HTTP requests to external websites, and use this data to validate a form.
Use a form submit hook to pass information down the form API and create a node programmatically.
Create an image file programmatically and attach a file to a node.
Check and create taxonomy terms programmatically.
Create an install hook to pre-define a list of films to import.
Create a custom Drush command, which makes use of re-usable functions within our Movie Import module.
Create an administration form to save information about how the movie importer works by using variables.
Create a permissions hook to secure access to pages within Drupal.
Learn how to use Features to manage configuration changes and understand the configuration change workflow in a team environment.
Use hooks to update the database tables and alter form elements.
Create autocomplete fields and menu hooks.
Add user data to the database from an existing form.