Hello!

I'm trying to build my own theme from scratch to have only what I need for my sites.
I have less regions than the system's own, and I get an error :

Notice : Undefined index: sidebar_first dans include() (ligne 138 dans /.../modules/system/page.tpl.php).
The "sidebar_first" region isn't used in my theme, causing an error.

The regions I'm using are declared in the .info file and show up correctly in the blocks page, but aparently my page.tpl.php doesn't fully override the one from the system. Any idea what I should do ?

Thank you !

Comments

ju-73’s picture

Regions from my theme :

; ========================================
; Regions
; ========================================
regions[header]         = Header
regions[navigation]     = Navigation
regions[highlighted]    = Highlighted
regions[help]           = Help
regions[content]        = Content
regions[footer]         = Footer
regions[recherche]	= Zone de Recherche
regions[signature]	= Signature

I placed my custom page.tpl.php in my_theme/templates/system/
suppressed the two paragraphs :

if ($page['sidebar_first']):

endif;

if ($page['sidebar_second']):

endif;

I added my own regions, which didn't cause any problems.

megan_m’s picture

Did you clear the cache after creating that new page template file? In Drupal 7 you can enable theme debugging which will help you verify which template file it's using.

Woolwich Web Works: Custom web development

ju-73’s picture

Well that was the only thing I was sure about and thought I had done... but probably forgot or cleared the caches on the wrong site..

I checked about theme debugging, I'll do it :
$conf['theme_debug'] = true;
line to add in settings, right ?

Thanks again

How do I switch the question to resolved ?

Jaypan’s picture

You're trying to include sidebar_first and sidebar_second, but those are not defined in your theme.

ju-73’s picture

Thank you for your answer Jaypan, but no, I'm not trying to include sidebar_first and sidebar_second because I don't want them in my theme ; my page.tpl.php simply hadn't overwritten the one from Drupal's core yet (which was, as you say, trying to include the regions).

Thanks to Megan M who reminded me to check twice the logical things even if you think it's ok, the caches are now cleared, the new page.tpl has taken over, everything is fine !

I'm trying to remember how to pass the subject to resolved..

Thanks again to you both