I have created a module with that module I uploade images and this images are displayed in a swf file in the content-type swfgallery.
now I will implement a fullscreen node for this content-type (swfgallery)
I will do this with a costum page.tpl.php without $left $right …. the only output in
page-simpleplugin.tpl.php is $content->body.
What I have done:
function mymodul_preprocess_page(&$variables) {
foreach ($variables['template_files'] as $file) {
$template_files[] = $file;
if ($file == 'page-node') {
$template_files[] = 'page-'. $variables['node']->type;
}
}
$variables['template_files'] = $template_files;
}
I put this code in mymodul.module and then I get this output with the devel modul:
Template called:
page.tpl.php
File used:
themes/garland/page.tpl.php
Candidate template files:
page-node-3.tpl.php < page-swfgallery.tpl.php < page-node.tpl.php < page.tpl.php
Preprocess functions:
template_preprocess + template_preprocess_page + swfgallery_preprocess_page + phptemplate_preprocess_page
Now I copied the page.tpl.php in sites/default/modules/mymodul/ and renamed it to
page-swfgallery.tpl.php.
I cleaned the cache.
And nothing happened drupal again used the themes/garland/page.tpl.php file
Now I tried something I copied the page-swfgallery.tpl.php in the directory themes/garland .
And it works drupal called the templated page-swfgallery.tpl.php.!
What have I to do that drupal called the page-swfgallery.tpl.php in my modules/mymodule directory
Comments
[solved] costum page.tpl.php for node contentype implementing in
this code helps me
this link did help me
hook_theme_registry_alter
also interresting
screencast:
Different 5.x page templates depending on node type
hook_theme and tpl.php files: registering them with drupal, and passing variables
Theming Modules in Drupal 6