The theme engine do not include my "mytheme" "template.php" file and others... following situation:

Example directory:

  • themes/mytheme/
  • themes/mytheme/page.tpl.php
  • themes/mytheme/node.tpl.php
  • themes/mytheme/template.php
    • themes/mytheme/mysubtheme/
    • themes/mytheme/mysubtheme/style.css
    • themes/mytheme/mysubtheme/page.tpl.php

Now, if i switch to theme "mysubtheme" all my themed functions (primary, secondary links, etc.) defined in "themes/mytheme/template.php" are not executed (HTML code is not generated). What is wrong? If the "mysubtheme" is active there is additional no fallback to the file "themes/mytheme/node.tpl.php" if no "node.tpl.php" is found in "mysubtheme" directory.

Any way to solve this problem without duplicating all files? :-(

Comments

styro’s picture

$ cat themes/mytheme/mysubtheme/template.php

<?php
  include "../template.php";
?>

???

But I was under the (possibly mistaken) impression that only style.css worked in a subtheme.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

hass’s picture

i tryed this and added a template.php with an include to the subdir... and this ends with:

warning: include(../../template.php) [function.include]: failed to open stream: No such file or directory in c:\Inetpub\wwwroot\drupal\themes\mytheme\layout\mysubtheme1\template.php on line 13.
hass’s picture

the following code works... but with this way i must include all files, create tons of "dummy" files :-((( and duplicated files, all simply for including upper directory level files :-(.

include realpath(dirname(__FILE__) . "/" . "../../template.php");

if this only works for style.css how should i change the page.tpl.php sourcecode then? difficult... for e.g. i must remove some div's or add others...

Why is there no fallback? Maybe i missed something...