Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

First off I am very new to Drupal but not very new to other frameworks and CMS's (symfony, cake, codeigniter, wordpress)

So I am trying to make a theme and it seems like I want to put a lot more stuff in html.tpl.php then drupal wants me to?

Like for example $logo, why is that not available in html.tpl.php, I don't want to include that in every variation of the page template, do I?

Or should I be thinking of page.tpl.php more as the wrapper than html.tpl.php.

I basically think the page template should only display content for that page, anything around that (ie, nav, logo, footer) should be in html.tpl.php. but drupal seems to be set up opposite? Why does this feel wrong to me?

share|improve this question
    
In d6 the html.tpl.php template didn't exist, they split it out so you didn't have to keep messing with the doctype and all the stuff that goes in <head>. You are right, page.tpl.php is also more of a wrapper, you should try not to have a lot of them. Are you building a theme from scratch or using a base theme? It might be better to start off by making a Zen subtheme (it is very well commented so you can learn a lot from it) or using one of the other base themes. –  sarahjean Oct 27 '12 at 17:22

1 Answer 1

Something to keep in mind is that Drupal doesn't work with templates the way a traditional MVC framework will. Ideally you want to have as few templates as possible in your theme, i.e having only one page.tpl.php with some conditionals would be best. If you do need to split things up you can define additional templates with hook_theme() in your theme's template.php and move your header/footer section into there, but in general you'll have better results by not having lots of template variations.

share|improve this answer
    
+1 for pointing out that these are not pure mvc. –  AyeshK Oct 27 '12 at 3:04
    
Thanks, for this, i think it makes more sense now that I know its intentions vs my preconceptions. I see now its probably easier to change my ways rather than try to bend drupal to my will :-) –  user1411464 Oct 29 '12 at 15:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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