December 2016
Beginner to intermediate
1005 pages
21h 54m
English
In Drupal, a block is a piece of content that can be placed in a region provided by a theme. Blocks are used to present specific kinds of content, such as a user login form, a snippet of text, and many more.
Blocks are configuration entities, and the block module uses the Drupal plugin system as a way to define blocks for modules. Custom blocks are defined in the PHP code in the module's Plugin class namespace. Each class in the Plugin/Block namespace will be discovered by the block module's plugin manager.
In this recipe, we will define a block that will display a copyright snippet and the current year, and place it in the footer region.
Create a new module like the one shown in this recipe. We will refer ...
Read now
Unlock full access