The documentation of the pattern argument does not really make any sense to me.
What I was looking for was this:
How do I actually do something like this in hook_theme (in pseudo-code):
'tmplfamily_[specialization]' = array(
'template' => 'tmplfamily_[specialization]',
...
}
where this should apply automatically to all theme('tmplfamily_[specialization]', $args)
such as
theme('tmplfamily_example1', $args);
which should then invoke tmplfamily_example1.tpl.php
I can't make it work from the documentation, and can't even decide whether 'pattern' would help there or not. The documentation is at least missing a complete working example.
Comments
Comment #1
asgalon commentedComment #2
Anonymous (not verified) commentedThe description given for that array key should be expanded, as it is not clear how it is possible to use dynamic names for themes.
The description reports an example of call to the
theme()function, but it's not clear to me where such call should be used.Comment #3
Anonymous (not verified) commentedComment #4
jhodgdonGood idea to document this better and better yet, give an example in the hook's function body.
It should be documented in Drupal 7 first, and then backported to Drupal 6.
Comment #5
Anonymous (not verified) commentedOn http://drupal.org/update/modules/6/7#theme_hook_suggestions_1 there is example code for Drupal 6, and Drupal 7.
Comment #6
jhodgdonThis was updated on another issue.