How can I load a template from a custom module on a certain page?

I have a page at path /user/{id}/module, and I’m trying to have Drupal load a custom template from my module when this page is accessed.

The twig debug output shows suggestions for the template name like below, but it doesn’t seem to pick the template up even after cache rebuilds. The page needs to show for all users so cannot pin it to a specific id, but html--user--module.html.twig is not respected.

<!-- FILE NAME SUGGESTIONS:
   * html--user--module.html.twig
   * html--user--123456.html.twig
   * html--user--%.html.twig
   * html--user.html.twig
   x html.html.twig
-->

Is there some syntax I’ve not been able to find like html--user--wildcard-id--module.html.twig?


Go to Source of this post
Author Of this post: nublet
Title Of post: How can I load a template from a custom module on a certain page?
Author Link: {authorlink}