I want to use template, which name is determined in runtime (specialized template). If such template is not defined, use fallback template with fixed name (like node-sometype.tpl.php is used before node.tpl.php):
return theme( array('my_theme_'.$node->type, 'my_theme'), $some_arguments );
If I do not declare specialized templates in my hook_theme, and just make my_theme_page.tpl.php files in theme directory, they are not used.
If I declare them (here themes are specialized by node type, so it is possible), Drupal always uses them, producing include/call_user_func error, instead of using fallback one.
$themes = array( 'my_theme' => array( 'arguments' => array('some_arguments'=>NULL), 'template' => 'my_theme', 'path' => $path, ), ); foreach (node_get_types() as $type => $_) $themes['my_theme_'.$type] = array( 'arguments' => array('some_arguments'=>NULL), 'template' => 'my_theme_'.$type, 'path' => $path, );
So the question is:
How to declare theme in module, without providing implementation, so it can be used with theme() fallback mechanism.