When I provide my sub-theme with a page.tpl.php file and switch the default theme to another one I have issues.
When i go back to the index (i use a different theme as admin theme) the style is missing. When i check the source of the html i dont see the sub-themes css files anymore. It looks like the template.php of the sub-theme is not parsed anymore. It doesn't matter if i switch back and fort between themes, the sub-theme won't work anymore until i remove the page.tpl.php again.

My drupal version is 5.2

Carlo

Comments

jjeff’s picture

I believe that the problem is that as soon as you create a page.tpl.php file, PHPTemplate sees this as a new theme. This is the reason that I started the Zengine theme engine and also the reason that Drupal 6 now uses .info files.

If you're wanting to create a "sub" theme with complete page templates, you should probably check out Zengine... perhaps you can help me document it! ;-)

blb’s picture

i am having the same trouble. is there any way to hide the .tpl.php files from the engine?

alternatively, is their a straightfoward conversion process between zen and zengine?

Shawn Parr’s picture

I also have seen this issue. My workaround is to either:

1a. rename the page.tpl.php to something else

or

1b. delete the page.tpl.php

2. Navigate back into the Themes admin page

3. Put back/rename the page.tpl.php.

Annoying, but solvable for the time being. Is there a smooth transition to Zengine? I know that zen has apparently split into 3 projects and I would like to go with something that is stable from a development standpoint.

I'm actually using the latest version of Zen (5.x-0.6 IIR).

johnalbin’s picture

When I start work on http://drupal.org/node/171464, I will look at this issue too.

neurojavi’s picture

Priority: Normal » Critical

I have the same issue.
I have to rename page.tpl.php every time I go to admin/build/themes
The problem is in the phptemplate_templates funtion in phptemplate.engine. This function uses the presence of a page.tpl.php file to determine the primary phptemplate themes list.

function phptemplate_templates($directory = 'themes') {
  return drupal_system_listing('^page\.tpl\.php$', $directory, 'filename');
}

I've lost some hours with this issue... (I've found this bug report later, when trying to post the issue)
I think this is a critical bug.
If the page.tpl.php overide doesn't work, I think it would be better for this functionality to be removed (or fixed if there's a easy way)

As someone asked before:
is there a straightfoward conversion process between zen and zengine?
and Is zenengine mature for production use?

neurojavi’s picture

Title: sub-theme with page.tpl.php » Some css files don't get loaded (sub-theme with page.tpl.php)

More descriptive tittle with the symptom (and the cause)
This is easiest to find

johnalbin’s picture

Title: Some css files don't get loaded (sub-theme with page.tpl.php) » Base CSS and tpl files don't get loaded (sub-theme with page.tpl.php)

About to commit a fix for this.

johnalbin’s picture

Status: Active » Fixed

Added a zen-subtheme.php file that should be copied and included by sub-themes of Zen.

See the new zen_classic sub-theme for details.

steve hawkins’s picture

Hey John,

The zen-subtheme files are marked as dead in cvs?

johnalbin’s picture

All the work has been going on in DRUPAL-5, not in HEAD. I've now synced HEAD with DRUPAL-5, so the new 5.x files don't appear to be in the Attic. Better?

johnalbin’s picture

I've implemented a better solution for this problem. The previous solution would have resulted in multiple copies of zen-subtheme.php and inevitable code drift.

The new solution is to include zen's template.php from the sub-theme's template.php file and let zen's template.php do all the heavy lifting.

In the sub-theme's template.php:

/*
 * Sub-themes with their own page.tpl.php files are seen by PHPTemplate as their
 * own theme (seperate from Zen). So we need to re-connect those sub-themes
 * with the main Zen theme.
 */
global $theme;
if ($theme != 'zen') {
  $themes = list_themes();
  include_once './'. dirname($themes['zen']->filename) .'/template.php';
}

This has been committed to 5.x-1.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

johnalbin’s picture

Not sure why I didn’t think of this sooner. This is now the preferred way (as seen in zen_classic’s template.php):


include_once './'. drupal_get_path('theme', 'zen') .'/template.php';