I have a module that implements HOOK_theme()
to define a 'petition' theme like so:
function mymod_theme() {
return [
'petititon' => ['variables' => ['foo'=>NULL], 'template' => 'petition']
];
}
Which I then use like:
$some_render_array[] = [ '#theme' => 'petition', '#foo' => 'Bar' ];
Which is then rendered by a petition.tpl.php
template file.
However, I would like to do this:
$some_render_array[] = [
'#theme' => 'petition',
'#theme_hook_suggestions' => ['petition__1'],
'#foo' => '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.