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.
Today's Drupal developer needs more than just a text editor and FTP. Best practice Drupal development involves a suite of tools, processes, and more than one server environment.
This tutorial is directed toward an audience that is not familiar with best practices in Drupal Development and methods involving version control with Git, IDEs, local development environments, and deployment environments (i.e. stage, live). Here we're providing a high-level overview of these topics with links to dive deeper if you need more information.
In this tutorial, we'll cover:
- Introduce Version Control Systems such as Git
- Discuss how Git can be used to deploy to remote web servers
- Review programming-centric text editors and Integrated Development Environments
- Identify the need for a local development environment.
- Explain shared deployment environments including production and stage.
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.
Display custom content using a render array.
Render content which can be refreshed via Ajax.
Create a custom block with details from the database containing information about user preferences.