By rylowry@gmail.com on
I am working with some entities that get themed with a #theme property in a renderable array. I would like to add some theme suggestions, so the entity could be rendered differently if a template is available. Something like this...
$element = array(
'#theme' => 'entity',
'#theme_hook_suggestions' => array('some_other_function'),
);
However, this doesn't seem to work. Can anyone confirm or deny whether such a thing is even possible? I have a feeling this is just wishful thinking.
Comments
Found a solution
I found a solution to my problem. I abandoned #theme_hook_suggestions, which just wasn't working, and ended up using the 'pattern' propery in my hook_theme function.
... and later on in my entity class ....
By adding the pattern in hook_theme, bundle type specific templates can get picked up if the are present, but if not, the theme function will fallback to template_page_template. All is good :D