Building "Blocks" of Drupal 8 with Plugins

ameeuwsen

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
  • Theming 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.

Session Track

Coding and Development

Experience Level

Intermediate

Drupal Version