Scroll
Creating block in Drupal module programmatically
Unlike in Drupal 7, creating multiple instances of a block to place on your site is a simple task in Drupal 8.
This tutorial will teach you how to programmatically add a block to the block layout interface, how to add an (administrative) configuration form to the block, and how to handle it. Finally, you’ll learn how to define and display default configuration values for the form.
Before starting this step-by-step guide, prepare your module skeleton as described in “Prepare the module skeleton.”
Source URL:
Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.