Drupal 8 Blocks
Hey there,
Coming straight to the point, there has been a lot of changes in Drupal8, on how blocks are made and rendered on frontend.
To make a block in Drupal 7 we have to declare it in the hook_block_info()
which gave the basic definition of the block.
hook_block_configure
and hook_block_save
can be used respectively to give the configurational settings and save our settings in database or in a particular variable. We mainly used hook_block_view
to show the output.
In Drupal8 this has changed completely.
Blocks in Drupal 8 are actually made up of two separate API structures to create a user experience similar to what Drupal has maintained in past iterations. These two APIs are the Block Plugin API, which is a stand-alone reusable API and the Block Entity API which is a Drupal 8 specific use case of block placement and visibility control.
-
TAGS:
- Drupal 8
- Drupal
- learning