Photo taken at the Druplicon with Drupal professional Marcel Ritsema and the team of Dutch Drupal shop Merge.
So what is an all-round Drupal professional like me? That's someone who mainly uses Drupal as a tool to build websites and web apps, knows how to build a module and a theme (sometimes shares them with the community), but does not necessarily understand all the nuts and bolts of core, especially of the Drupal 8 core.
This blog post is about the 5 most valuable talks I’ve been to at the DrupalCon, or watched online afterwards. I left out the keynotes since they're a must-see for any drupalista no matter what your expertise or background. Obviously I haven’t seen all of the talks yet, so if you’ve seen better or more interesting ones, please let me know in the comments.
If you’re coming from Drupal 7, 6 or even 5, there is a high probability that you’re not yet entirely comfortable with the (now widely used) practice of object-oriented programming (OOP). This talk is a crash course on what OOP really is about and specifically how OOP for PHP works.
Even if you already know about OOP, this talk will still help you to get a clear and refreshing overview of it’s main concepts. This talk also helps you understand why OOP is so important (and it will leave you wondering why the hell we didn’t start using it for D7). OOP is all about making our lives easier. With OOP we avoid building spaghetti code, we avoid having to write more code than we need and we avoid PHP loading code it doesn’t really need for a specific page.
The speaker Lorna has a very didactical, almost childish, way of presenting, and you might feel like you're back at primary schools’ math class. But there’s no doubt that when the 45 minutes are done you won’t ever forget what classes, methods, interfaces and traits are and how to use them.
Remember the Drupal 7 info hooks, such as hook_field_formatter_info or hook_block_info? Well, in Drupal 8 they are no longer. Instead, we now use Plugins.
Plugins are a new way of describing specific functionality you might need for your website. There are a number of very technical descriptions of the concept of plugins, some of them touched upon by the speaker, but the easiest to understand is the speakers' own definition of plugins. I paraphrase: "plugins describe one specific action (e.g. change color) on one specific recipient (e.g. on images) and are configurable and reusable."
If you’re still thinking in info hooks, than this talk is a perfect way to get you acquainted with the new Plugin system. The speaker talks about the different aspects of the plugins and the advantages over the old way of doing things, such as lazy-loading, PSA 4 compliancy, and the fact it's a lot easier to (re-)use. The speaker uses the example of an Ice Cream Shop and very simple and clear code snippets to walk through the different bits and pieces of the Plugin system.
Most of the time we will just want to define a new plugin of an already existing plugin-type, but what if you want to create something completely new? Then the second part of the speech is about how to build your own PluginManager and how to tweak literally everything from PluginDiscovery to PluginFactories, or just use Drupals default classes (and it will almost work out of the box).
In the same way the Drupal 8 Crash Course taught us about back-end, this talk is a high-speed walkthrough of the new front-end features of Drupal 8. This talk is a must-see, not only because you can’t possibly get up to date quicker than this, but also because it’s arguably one of the most entertaining speeches of the DrupalCon.
The talk quickly runs through how the new theme layer works with sensible defaults and how easy it is to do it differently if the sensible defaults don’t sound sensible to you at all.
We learn all about the new theming engine TWIG, which makes life a lot easier for both front and back-enders. In a dazzling 60 seconds we see the most useful features and after that we learn how easy it is to debug templates. Some of the more conceptual improvements and decisions are mentioned too, such as the fact that theme functions are slowly being replaced with template files and why it was decided,for example, not to include bootstrap or other popular libraries.
I liked this speech because it had some very welcome self-awareness amidst the Drupal hallelujah of the DrupalCon. When we’re trying to get a business case, we’re not trying to convince our fellow drupalistas of the power of Drupal (which shouldn’t be too hard). Instead we’re trying to convince a client who most of the time has never heard of Drupal.
This talk is about how and when to expose the power of Drupal to our clients. Drupal can do a hell of a lot, and it’s all too easy to overwhelm your client with what it can do, for example by demoing to soon or demoing stuff the client doesn’t need. So don’t show off Drupal for the sake of Drupal, simply because “Nobody cares about Drupal”, as was made clear in one of the very first slides. Clients care about what how Drupal can solve their problems, not the fact that it’s called Drupal.
Another important message was that Drupal has disadvantages and isn’t perfect and clients often have different preferred systems which could be adequate too. The client will sometimes have his arguments against Drupal lined up to fire at will: safety concerns, mistrust of open source, bad experiences. Try to parry those attacks not by denying the weak spots but focussing on the advantages, such as the strong community, the flexibility or your own experience and portfolio.
For me it was the very first talk after Dries’ keynote and it was the perfect way to get to know all the power of Drupal 8. In 45 minutes you will learn everything about the new integration with Symfony 2, how plugins and services work and how easy it has become to build stuff in Drupal 8.
When you first install D8 it looks like almost nothing has changed, but under the hood almost everything has changed. Drupal 7 moved from hooks to OOP, from idiosyncrasy to industry standards, from a slight degree of randomness to utter consistency.
Larry Garfields starts off with an explanation of Symfony’s HTTPKernel Pipeline that was used for Drupal 8, which might be a bit abstract for some but very relevant when you want to build, for example, a mobile application.
After that Larry leads us through all the steps of making your custom module in Drupal 8 with the imaginary ‘Hugs’ module, which tracks the amount of hugs one user might give to the other (feel the love). He shows us how we build the modules’ configuration and how Drupal handles state information. He also shows us what the difference is between the new Drupal 8 concepts of Plugins and services and how they relate to the way we did things in Drupal 7.
Since Drupal 8 is now object oriented, it’s all about extending base classes. Newbies to Drupal that are used to OOP shouldn’t have too much of a hard time learning Drupal any more. Basically there are only two main steps involved in building anything: 1. Build a tool. 2.Wire it to the system. Or in other words: 1. Extend a base class, 2. tell Drupal about it.