hussainweb.me: How to get the current node in a block plugin in Drupal 8

0 Flares Twitter 0 Facebook 0 Filament.io 0 Flares ×

I was trying to build a block plugin in Drupal 8 recently. The requirement was straight-forward. I would show these blocks on node pages of a certain type. Depending on the values in that node, the block content changes.

The requirements are straight-forward but there are a lot of things to consider in this scenario. […]