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
Hello,
I want to create a custom block as part of my module.
Then I want to show this block on two pages.
Is there a way, for example via these yml Files, I can configure that the block should be shown on pages with a certain routes.
I mean just like in the mymodule.links.actions.xml I would like to be able to create a yml file that says:
mymodule.myblock:
title: 'Special Block'
appears_on:
- entity.mymodule_country.canonical
- entity.mymodule_town.canonical
Is there a way I can do that?