Session Description

The release of Drupal 8 brings with it a completely overhauled Block API system, in which blocks are now entities. While this is a priceless tool developers have been wanting for a while, it can be a bit daunting at first when trying to create a block in custom code. This session will highlight some of the more powerful features of the Drupal 8 block system, as well as some gotchas and best practices. Through a streamlined demo this session focuses on the bare minimum to get a block plugin up and running, as well as leveraging new block features to add custom configuration like never before.

In this session you will learn how to define and place various parts of a block entity through custom code.  This will include:

  • What is a block plugin and why do I want to know about it?
  • Creating a block plugin
  • Adding custom configuration to a block plugin
  • Placing a block plugin
  • Exporting a block plugin
  • Importing a block plugin

Plan to leave this session knowing how to write, install and configure a block plugin from scratch, as well as how to use blocks in various ways on your Drupal 8 sites.

This is meant to be a hands on session; this means following along on your own computer with example code provided. To be prepared for this session please clone the Drupal 8 site from the repo located here: https://github.com/ameeuwsen/MidCamp2016Blocks.git and install the site as you would normally. Doing this and following along will help you get the most from this session.


Site Building



Drupal beginners


Session length

60 minutes

Session Assignment

SRH 219 - Breakthrough Technologies
Saturday 4:00 pm - 5:00 pm

Session video