I wonder how to develop a custom theme from scratch. I understand the overall structure of Drupal theme. I've created an .info file and enabled the theme through the admin interface, but I get a blank screen.

I haven't yet coded any of the theme files. I'm unable to define html.tpl.php, page.tpl.php, node.tpl.php, region.tpl.php.

I do have empty css, js and images folders. In my templates folder I've an empty html.tpl.php, page.tpl.php, node.tpl.php, region.tpl.php, field.tpl.php.

Any suggestions?

  • a good starting point would be to copy the templates of an existing theme that most closely resembles your custom theme into your custom templates folder, then customize these. The templates print the various page elements so if you have blank templates nothing would be printed, hence you see a blank page. – longboardnode Aug 10 '16 at 13:13
  • 1
    Sorry but our aim isn't to reproduce documentation or provide broad tutorials, rather to answer more specific questions. The theming guide has all the information you need in it, if you get stuck at a particular part please ask a specific question about that – Clive Aug 10 '16 at 13:32
  • As an "educated person" yourself, you'll no doubt recall agreeing to ask questions that follow our, admittedly strict, guidelines, when you signed up. So far you haven't been doing that consistently, and some are getting closed. There isn't really any more to be said about it, taking it out on me won't solve anything. – Clive Aug 10 '16 at 17:57

Hello World

It seems that the current version of your theme works as designed: empty templates that result in a blank screen, that's exactly what "I" would expect. Try adding "Hello Umair" in any of those empty files, and see what you get next.

Start from an example

A much more effective approach however might be as suggested by longboardnode : copy from whatever theme you like, and apply the "same-as-except"-strategy.

Start from a base theme

Or maybe create a subtheme from your favorite base-theme (Omega, Zen, Bootstrap, ... there are plenty to pick from).

Follow the instructions in the documentation

An extremely basic example you may want to look at: Create a new custom theme with CSS alone. And if you're ready for it, study the Theming guide, especially the Theming Drupal 6 and 7 child pages of it.

| improve this answer | |

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