Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By MaWe4585 on
I have an Entity "Country" and I want to show a Block only on the entity.country.canonical page.
In that Block I want to show information specific to the current Country record.
Now I learned that there is the possibility to use a ContextProvider to add information of the Entity to the Context, However I can't find a good example which really explains how this works.
Can someone provide an example of how this ContextProvider works in combination between Entity and Block?