Total newbie at Drupal. Is it valid to say that I could code a page in pure html/css and then start adding the php variables needed to eventually make the page.tpl.php?

Or should I go about it by creating the tpl.php file differently?

That feels possible but all the reading I've done hasn't explicitly said it that way.

  • If you haven't already, install and enable the Devel module, and use dpm() wrapped around the php variables to see what's in them. I can't do anything without dpm(). – beth Dec 17 '12 at 23:28
  • Beth also has a good point. The Devel module will make your life much easier! There is another module called Theme Developer which relies on the Devel module which has been very useful for me from time to time as well (drupal.org/project/devel_themer) – kevindeleon Dec 18 '12 at 14:47

You certainly could do it that way, however, that would require you to know all of the php necessary to make a fully functional Drupal page.tpl. What I would recommend, and how I started themeing (outside of reading a bunch!) was taking a page.tpl.php from a theme similar to what I was looking for and modifying it until I was happy with it. After doing this several times and experimenting a lot (and reading!) I became quite familiar with the templating system used in Drupal and the php code needed in the most common template files.

|improve this answer|||||
  • no problem...good luck with your theme. – kevindeleon Dec 17 '12 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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