Problem/Motivation

Using the templates/page.tpl.php file provided in the Bartik theme generates (needless) PHP warnings.

Proposed resolution

Patch attached

CommentFileSizeAuthor
page.tpl_.php_.diff3.44 KBleewillis77

Comments

droplet’s picture

Status: Active » Postponed (maintainer needs more info)

at what case you see these error? most of them are global theme $var, should be init. before theme loaded

leewillis77’s picture

So - I have a fresh install of drupal 7.9, and I'm developing my own theme.

I've created my own theme, created the .info and .css files, and then copied the page.tlp.php in from Bartik to use as a base to customise. If I access any page on the frontend of my site that uses that as a template then I get the errors, e.g.

Notice: Undefined index: featured in include() (line 133 of /var/www/webserver/snugbaby/sites/default/themes/snugbaby/page.tpl.php).

Note: I'm newish to drupal, so if I'm doing something wacky - do let me know - but everything seems sensible [And is working aside from the warnings], I'm guessing the warnings are triggered because I haven't configured those blocks, but since I have no intention of using them I don't think I should have to?

droplet’s picture

Category: bug » support

you need to make a sub-theme:
http://drupal.org/node/225125

or also copy the template.php to your theme folder.

leewillis77’s picture

I should have mentioned that my theme is already a subtheme, e.g. the .info file is:

name = Snugbaby
base theme = bartik
description = Snugbaby Themes
version = 0.1
core = 7.x
stylesheets[all][] = snugbaby.css

Shouldn't that result in template.php being included from bartik?

droplet’s picture

@leewillis,

Region inheritance

Sub-themes do not inherit custom regions from a parent theme. If you are using custom regions, you should copy the region declarations from the parent theme's .info file. Be sure your sub-theme's page.tpl.php file matches the sub-theme's region settings.

leewillis77’s picture

Perfect - that sorted it - sorry for wasting your time :)

Everett Zufelt’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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