theme_hook_suggestions on custom theme? I have a module that implements HOOK_theme() to define a 'petition' theme like so:

function mymod_theme() {
  return [
    'petititon' =&gt; ['variables' =&gt; ['foo'=&gt;NULL], 'template' =&gt; 'petition']
  ];
}


Which I then use like:

$some_render_array[] = [ '#theme' =&gt; 'petition', '#foo' =&gt; 'Bar' ];


Which is then rendered by a petition.tpl.php template file.

However, I would like to do this:

$some_render_array[] = [
  '#theme' =&gt; 'petition',
  '#theme_hook_suggestions' =&gt; ['petition__1'],
  '#foo' =&gt; 'Bar'
];


...and have it look for petition--1.tpl.php, in the same way you can for nodes, pages etc.

But this doesn't seem to work. Is it possible to have a theme that can take a template suggestion? I have a bunch of things to render which all require the same processing but use different templates.
To suggest specific templates you probably need to do it in your theme's template file, use the hook_preprocess_HOOK where the first hook is the name of your theme and seconde HOOK is either page to suggest a page template or node to suggest a node page.

Here's an example

/**
 * Implementation of hook_preprocess_HOOK().
 */
function mymodule_preprocess_page(&amp;$variables){
  // change the condition to whatever you like
  if(isset($variables['node']) &amp;&amp; arg(2) != 'edit')
    $variables['theme_hook_suggestions'][] = 'page__'. $variables['node']-&gt;type;
}