Hello,

I have made changes to the page.tpl.php file but they are not appearing on the site. Here are the steps I've taken:

1) Copied the templates folder from the at_core directory and placed it in my template root directory. sites>all>themes>my_theme>templates. As described at documentation/using-template-overrides.

2) Modified the template php to reflect I was enabling this process;

function my_theme_preprocess_page(&$vars) {
}
function my_theme_process_page(&$vars) {
}

3) Cleared Cache, Devel is running with 'Rebuild the theme registry on every page load' checked as well.

4) modified page.tpl.php

Modified page.tpl.php changes not reflected. Tried repeating these steps several times while disabling both AT Core and my_theme, dumped cache at every turn (I've dumped so much cache I can't afford coffee now), restarted apache & mysql, rebooted the server. I made changes with another theme and those changes worked. All themes except Bartik AT-Core an my_theme have been disabled. Tried placing the templates folder in the generated_files dir, made sure there were no stray *.tpl.php in my subtheme or AT-Core theme dir.

Any help is greatly appreciated.

Thanks,
7

Comments

The_Fiend’s picture

Issue summary: View changes
The_Fiend’s picture

Issue summary: View changes
The_Fiend’s picture

Howdy,

Update

I set Bartik as the default,
Disabled AT and my AT Sub,
Cleared the cache,
Tested Bartik
Deleted the AT and AT sub folders,
Cleared the cache again,
Downloaded AT again,
Uploaded the dirs,
Configured the subtheme.info, theme-settings.php and template.php files with my theme info,
Tested Bartik , clean with no errors,
Enabled my AT subtheme,
tested it all, clean with no errors,
Placed only the page.tpl.php file in the templates directory within the subtheme root with echo '<p>Hello World</p>'; added to the file to test,
Tested, no Hello World
Configured the template.php by enabling the process_page and preprocess_page functions,
Tested, no Hello World.

I'm at a loss o.O
Thanks for looking into it.
7

The_Fiend’s picture

Update 2

Renamed the page.tpl.php to page--front.tpl.php and it works from the mysubtheme/templates directory just fine. I wonder why it does not like the page.tpl.php file.

Thanks,
7

The_Fiend’s picture

Category: Support request » Bug report
The_Fiend’s picture

Upgraded to bug report.

Jeff Burnz’s picture

Status: Active » Postponed (maintainer needs more info)

I can't repeat the issue, I run custom page.tpl.php files on most themes I build and haven't experienced this. I ran a test with AT Mono against current AT Core dev - no issues, template suggestions report as normal and work normally.

Are you using Panels or any other page layout type modules?

What is the output of

var_dump($vars['theme_hook_suggestions']);

run from process or preprocess page for this theme?

What is your file/directory structure, are you embedding sub themes inside other themes?

Certainly an odd issue for you and I would think quite frustrating, we can get to the bottom of it :)

The_Fiend’s picture

Hi Jeff,

I am using panels and pages, but only started with those after I had problems with the tpl not taking. Those appear to be fine.

var_dump($vars['theme_hook_suggestions']);

Returns NULL when viewed on front page, error shown on admin pages:
Notice: Undefined variable: vars in include() (line 176 of /var/www/mythemesdomain.com/public_html/sites/all/themes/mytheme/templates/page--front.tpl.php).

Now if I have that code in the page.tpl.php and not the page--front.tpl.php no error is kicked because it is not grabbing the tpl I presume.

template.php changes (removed '/* -- Delete this line if you want to use these functions'):
/**
* Override or insert variables for the page templates.
*/

function mytheme_preprocess_page(&$vars) {
}
function mytheme_process_page(&$vars) {
}
// */

Directory Structure:
sites/all/modules
sites/all/libraries
sites/all/themes

/sites/all/themes/adaptivetheme
(and the various stock folders which I have not touched)

/sites/all/themes/mytheme
/sites/all/themes/mytheme/css
/sites/all/themes/mytheme/generated_files
/sites/all/themes/mytheme/images
/sites/all/themes/mytheme/layouts
/sites/all/themes/mytheme/sass
/sites/all/themes/mytheme/scripts
/sites/all/themes/mytheme/templates

/sites/all/themes/mytheme/templates/page--front.tpl.php <--Works.
/sites/all/themes/mytheme/templates/page.tpl.php <-- Does not work, have tested with it being the only file in the templates dir.

The page.tpl.php file copied from /sites/all/themes/adaptivetheme/at_core/templates.
The page--front.tpl.php is a renamed copy of page.tpl.php file from /sites/all/themes/adaptivetheme/at_core/templates dir.

Thanks for helping on this. I just started with Drupal last month, tried a bunch of premade themes... never again. Actually ended up blowing out the Drupal install and starting over after the last “fire & forget” theme. I tried 2 other framework themes but did not like the coding, implementation, or overall feel of them. They both had way too many errors out the gate when the code was checked on base installs. I forget the numbers but both of these themes were in the several 100s for basic code errors, and they like this are in top group of framework themes used.

If you need more info please ask. Please do note that I *just* started with Drupal so I most likely screwed up somewhere, just don’t know where.

The_Fiend’s picture

Hey Jeff,

What other information do yo need?

Thanks

The_Fiend’s picture

Ran this from the template.php

function hobby_fiend_theme_preprocess_page(&$vars) {
var_dump($vars['theme_hook_suggestions']);

}
function hobby_fiend_theme_process_page(&$vars) {
var_dump($vars['theme_hook_suggestions']);
}

array(2) { [0]=> string(10) "page__node" [1]=> string(11) "page__front" }

array(3) { [0]=> string(25) "page__full_width_wrappers" [1]=> string(10) "page__node" [2]=> string(11) "page__front" }

Thanks

The_Fiend’s picture

It's been over 2 weeks since I provided the information you requested yet the bug still remains in 'postponed' mode. Please advise what else needs to be done to receive support for this issue.

Thank you.

The_Fiend’s picture

Another week has ticked by. A month ago and you requested more information and put the bug into postponed mode. I provided the answers to your questions almost immediately. Is there any hope of getting a response?

The_Fiend’s picture

Hello? Is anyone out there?

T.Mardi’s picture

@The_Fiend, I normally place the tpl files in the root folder of my subtheme, not in a folder called templates. Have you tried that?

So your structure is sites>all>themes>your_theme>page.tpl.php

pat64j’s picture

Hi,
I run into this issue when using drupal with adaptive theme.
This is my solution; just in case someone runs into a similar problem.

In your theme settings page, if you have the configuration with the little "Markup overrides"
enabled, then in you should override the "page--full-width-wrappers.tpl.php" instead of the page.tpl.php.

Jeff Burnz’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

My apologies for not having the time to follow up on this, about a year ago I was in the middle of moving around the world and only really have time now to catch up with D7 contrib.

jibrille’s picture

#15 solved it for me! Thank you so much!

Yehorko’s picture

Might be useful:
i met problem with templates definition caused by wrong chmod of newly created template, when i developed under Linux.