I have generated a custom content entity via the Drupal Console. It has bundles. I would like to customise the screen which you get to when adding a new such entity - the screen which displays the list of bundles, to click on the type you want to add.
When I generated the entity, a bunch of template files were created, including one called <my_entity>-content-add-list.html.twig
. I am certain this is intended to override the core template called entity-add-list-html.twig
. However, changes I make to it do not take effect, and by putting twig in debug mode and viewing the source, I can see that it is not being overridden.
Do I need to add a theme suggestion hook? If so, what would the name of the function be? I feel like I must be missing something. Given that the console generated that template I am surprised it is not automatically used. But surely there must be a simple way of telling Drupal to use it.
EDIT: I've found what to name the function: it's mymodule_theme_suggestions_entity_add_list
. But the machine name of the entity is nowhere in the $variables array that I can easily get at. I'm looking at parsing the route to get it out, which seems rather hacky