This tutorial provides an overview of the major shift in Drupal 8 to an object-oriented architecture and was created to help you understand which concepts and terminology you will need to learn in order to interact with modules at a code level.
Other tutorials in this series on "What's New in Drupal 8" will cover major changes in specific areas of Drupal 8 module development, such as entities and fields, configuration management, web services, and hooks. This tutorial will focus on object-oriented PHP architectural changes, concepts, and terminology you will need to know as a module developer.
Specifically, we will present:
- an overview of object-oriented PHP
- why it was introduced into Drupal 8
- how it differs from procedural programming
- major OO-PHP concepts you'll find in core
To learn object-oriented PHP, you should begin with our OOP topic page.
[# card #]
nid: 2926
title: OOP topic
[# endcard #]
Additional resources
- Object-oriented PHP topic page (drupalize.me)
- Why the big architectural changes in Drupal 8 article (buytaert.net)
- PHP Manual: Classes and Objects (php.net)
- Objected-oriented programming conventions (api.drupal.org)
- Services and Dependency Injection Container (api.drupal.org)
This video was part of a series of presentations produced in anticipation of Drupal 8's official release. For information about configuration management based on official releases of Drupal 8, view tutorials in our Configuration Management series.
[# card #]
nid: 2458
title: Config Management series
[# endcard #]
This presentation introduces the Drupal 8 configuration management system (CMI). Learn why configuration management is one of the most eagerly anticipated features of Drupal 8, and how it has the potential to completely change the workflow we use for building sites with Drupal. By addressing a number of long-standing issues in Drupal, CMI helps to separate content from configuration, provides a simple user interface for transporting configuration changes between multiple instances of the same site, and gives developers a consistent way to store and retrieve configuration in their code that is guaranteed to work with the rest of management tools provided.
Here's what we'll cover in this presentation:
- What is configuration management, and what problems does it solve
- The CMI user interface, and changes for site-builders
- The CMI API, and changes for modules developers
- What you can start learning now to ensure you're ready to use CMI
After watching this presentation you should have a better understanding of the importance of the new configuration management system and be excited about the improved workflows and ability to follow current best practices that it introduces to Drupal.
Additional resources
- Configuration Management tutorial series (Drupalize.Me)
- Introduction to YAML video tutorial
- Drupal.org documentation: Configuration API in Drupal 8
- Drupal.org documentation: Managing configuration in Drupal 8
- Principles of Configuration Management - Part One article by Chapter 3
- Principles of Configuration Management - Part Two article by Chapter 3
- The Drupal 8 configuration schema cheat sheet
This video was part of a series of presentations produced in anticipation of Drupal 8's official release. For information about theming based on official releases of Drupal 8, view tutorials in our Drupal 8 Theming Guide.
[# card #]
nid: 2512
title: D8 Theming series
[# endcard #]
This presentation outlines some of the major changes to the way that themes are built in Drupal 8 and is intended to help you generate a list of the things you're going to need to know in order to start making awesome Drupal 8 themes. A lot has changed, and there are a lot of new things to learn. However, one of the primary focuses has been on making the theme layer easier to understand, and easier to get started with.
Almost every aspect of the theming layer has been touched in one way or another during the Drupal 8 development cycle. We think some of the important ones to learn about are:
- How Drupal 8 makes the theme layer easier to understand
- Changes to help make Drupal responsive and mobile friendly
- The adoption of current best practices for HTML5, CSS, and JavaScript
- The addition of a new template engine based on Twig
After watching this presentation you should have a better understanding of the things you'll need to learn in order to create themes in Drupal 8 and where you might need to brush up.
Additional resources
- Drupal 8 Theming Guide (Drupalize.Me)
- Changes for themers
- Twig Theming video tutorial series
- Acquia's Ultimate Guide to Drupal 8: Episode 5 - Front-End Developer Improvements
- DrupalCorn Presentation by Marc Drummond: Building a Drupal 8 theme with new fangled awesomeness
- DrupalCon Sydney Presentation by Jen Lampton: Twig, and the New Theme Layer in Drupal 8
- DrupalCon Austin Presentation by Scott Reeves and Joël Pittet: Drupal 8 Theme System: hook_theme to Twig Template
What's New in Drupal 8
CourseA Peek at Traits in Drupal 8
Blog postPart of learning Drupal’s API is learning about “what’s in the pantry.” In Drupal 8, that pantry is configured quite a bit differently than before. Instead of getting the whole warehouse of Drupal functions on every page load, functions—well, now methods—are contained in objects which are defined by classes. Most, if not all, of these classes, which exist in their own PHP files, can be extended and many of them are specifically designed to be extended. These extensible classes are the pantries. They contain properties and methods that we can just use in the classes that extend them. When we extend these classes, we need to make sure we peek inside to see what’s available before we go elsewhere for something that might already be in the cupboard.
Podcast 59: DrupalCon Bogotá Recap
Blog postIn this week's episode, DrupalCon Bogotá Recap, Addi is joined by Lullabots Joe Shindelar, Chris Albrecht, Mike Herchel and Daniel Dalgo to talk about their awesome trip to Bogotá, Colombia for the first DrupalCon Latin America. We talk Drupal, highlights from the 'con, and some of the great things about Bogotá.
This week we're going to dive into the hands-on configuration for the Working with Drupal Multisite series.
In this lesson we'll be building a simple university site, udrupal.com, with different areas, each with their own website: the main site, a news site, and an alumni site. The news site is simply a subdomain of the main domain name, news.udrupal.com, and the alumni site actually has its own separate domain name, udrupalalumni.com. To get this done, you're going to learn how to confirm the DNS is working for the domain names. That is, that they are currently pointing to the right server. Then we're going to configure an Apache vhost on our server so that Apache knows where to find our Drupal code base. We'll finish things up by installing our main Drupal site, udrupal.com.
Additional resources
If we want to do development work on the university multisite, we need to do a few things to have this run smoothly in a local development environment with all of those URLs. The sites.php file is going to let us define aliases for the site configuration folders in /sites
. In this tutorial we'll explain why local development with multisite is tricky, and how to get it set up properly.
Additional resources
example.sites.php (api.drupal.org)
With our domains and Apache configuration in place, we need to make sure all three sites can be installed at the different domains by creating our multisite directories in the sites folder. In this tutorial, we'll create the necessary Drupal site directories and settings files for the three sites so they are all running smoothly, check the domains and install the other two sites, and wrap up by changing the theme on the alumni site.
Before we get started, you should make sure you have two empty databases created for the two new sites we'll be installing.
In this tutorial we're going to be working directly on a server using the command line. You can feel free to use a GUI interface for your site, like an SFTP app or just your local machine file browser and editor apps. If you want to brush up on using the command line, you can check out our free Command Line Basics series.
Drush is a really great tool for managing your Drupal site quickly and easily. If you don't already know about Drush, you should definitely check it out. When working with a multisite installation though, Drush can get confused if you don't give it all the information it needs. In this lesson we'll walk through how to use Drush properly with a multisite installation, covering both how to manage just an individual site and how to work with all of your sites at the same time.
Creating Block Types with Bean
Blog postWhether you're a Drupal beginner or veteran module developer, one thing everyone understands about Drupal is the core block system is very limiting. There are lots of modules out there that attempt to make blocks more robust. Heck, site builders have even used Views as a complete block replacement. There is one module that makes blocks a ton more useful and that is the Bean module (Block Entities Aren't Nodes). The Bean module replaces a lot of modules we used in the past to give blocks more power and function. Drupal 8 even works just like the Bean module out of the box. Instead of using Views or making nodes blocks, Bean gives us fieldable block types.
This week, we're kicking off a new series, Working with Drupal Multisite. We're also releasing a new video in our Drush series, Installing Drush with Composer.
Before we set up a multisite we need to understand how Apache and Drupal work together to deliver the site we intend. In this lesson we'll look at the documentation for Drupal multisites, and then discuss the way you need to set up your Drupal directories. We'll also review the workflow that Apache and Drupal go through to get the correct site displaying in the browser.
Additional resources
Multi-site - Sharing the same code base (drupal.org)
Building one Drupal site is a fair amount of work in and of itself. But what about working with multiple Drupal sites? Sometimes you have a few sites that make sense together, either from a maintenance perspective, or due to an overlap in content or users. There are a number of different ways to approach this in Drupal, and which path you follow varies considerably depending on the exact use case you need to fulfill. In this lesson we'll get a good look at the problem multiple sites can pose, and list out some common use cases. Then we'll take a look at three different broad categories of solutions, with some specific architectural approaches. The rest of this series will walk through managing multiple sites using Drupal core's built-in multisite system.
If you are interested in working with the Domain Access project instead of core multisite, you should look at the Introduction to Domain Access series.
When working with domain names and getting a website to show up in your browser, it can be a little confusing to sort out which bits of the puzzle are where. You need to be able to properly configure the domain name server (DNS) so your browser can match up a domain name with a web server, and then make sure the Apache web server knows which files to direct that incoming domain name to. In this lesson we're going to walk through the process from the browser request to the website files. We'll take a look at the Apache documentation on virtual hosts (or vhosts) and discuss where to find this configuration. Then we'll take a look at some example vhost files to see what's going on in there.
Additional resources
Welcome Blake and Will
Blog postWe're excited to introduce two new team members! Meet Blake Hall and Will Hetherington.
Podcast No. 58: Drupal Console
Blog postThis week on the podcast, Amber Matz chatted with Jesus Manuel Olivas about the Drupal Console project. What is Drupal Console? The Drupal Console is, at this time, a suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.
When working with REST in your code, you can use PhpStorm's built-in REST Client to help you track and test your API code.
Additional resources
Please note that this series covers PhpStorm versions 6 and 7 only.
For the latest documentation (including up-to-date videos), see JetBrains documentation.