Is it possible to pass context to a block plugin in Drupal 8?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Dustin@PI's picture

Is it possible to pass context to a block plugin in Drupal 8 (core)? Some of the early initiative discussion implied this would be possible but I have been able to find out how I would do it.

Example use case: Create a "Contact User" block, place it on user pages (picks up context from user page), but also place it on the "Help" page and the "Contact Us" page but for those pages set what users should be used. We have recently started creating all of our Panel panes this way in D7 and it is very effective

Is this possible with the new block plugin interface? If so are there any blocks in Core that are using this functionality that I can review?

Drupal 8: Blocks & Layouts Everywhere Initiative

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week