0

I've created a template with the following.

myTheme.info

name = myTheme
description = Just my theme
core = 7.x
stylesheets[all][] = css/myCss.css

regions[test] = Test
regions[content] = Content

template.php

// Empty file

css/myCss.css

// Some styles

Drupal has position content and other blocks, but from where did he gets the template if mine is empty?

Also I get these errors:

Notice: Undefined index: highlighted in include() (line 126 of Z:\home\test1.ru\www\modules\system\page.tpl.php).
Notice: Undefined index: sidebar_first in include() (line 138 of Z:\home\test1.ru\www\modules\system\page.tpl.php).
Notice: Undefined index: sidebar_second in include() (line 144 of Z:\home\test1.ru\www\modules\system\page.tpl.php).

It looks like it was used in the core template, but in my newly created template, I get this errors. Maybe I need to override some hooks? Which hooks should I override?

2 Answers 2

1

The variables for which you get those errors are the variables that Drupal uses to output the default regions a Drupal 7 theme should have, which are the following one.

regions[header] = Header
regions[highlighted] = Highlighted
regions[help] = Help
regions[content] = Content
regions[sidebar_first] = Left sidebar
regions[sidebar_second] = Right sidebar
regions[footer] = Footer

The template.php file is not a template file; it's the file containing functions template files use.

When your theme doesn't define a template file, Drupal uses the one defined from the module implementing the theme function. For example, the Node module defines theme_node(); if your theme doesn't have the template file used by that theme function (node.tpl.php), Drupal will use the template file that is in modules/node/node.tpl.php.

0

If not provided by the theme, Drupal loads templates from the relevant module folder

  1. Node
  2. Comment
  3. Block

etc...

also the 'system' module folder for some templates such as page.tpl. and html.tpl.php

Your undefined index errors are because your page.tpl.php is attempting to print out regions and variables that aren't defined by your theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.