Rather than relying on a hundred or so browser bookmarks to reference, I've chosen to document everything I've learned online on how to create a Drupal 7 Theme from scratch. It wasn't easy and it wasn't fun and I don't wish to do it again. So I posted a web page for myself and my colleagues and now I'm sharing it with the community. Feel free to use it as your reference guide and I'd love to hear your feedback.

Drupal 7 Theme from Scratch

Hopefully this is the proper place to post this. Seemed to make sense to me.

I've recently updated this documentation (06/23/2016) by adding some additional screenshots for newbies, tweaking some text to include more details and spreading the layout over several pages instead of just 1 page.

Comments

paean99’s picture

Nice.
Thank you.

C_0nfig’s picture

You my friend, deserve a medal. I just started to read and man...i'm really new to drupal dev, hopefully i'll find all i need in this "article"

C_0nfig’s picture

At the end of form-template-page.tpl.php
add this or AJAX (e. calling field-collection field and using dynamic add-more will not work ) will not work
print drupal_render_children($form);

tenten71’s picture

Sorry for the late response. I thought I was setup to get emails to alert me.

What are you referring to? I don't have any form-template-page.tpl.php in my theme.

nikita.rane’s picture

Hi tenten71,

I read your documentation it's really good and very useful

Just to add up in the process of doing modification in theme I think making sub-theme is best practice before making modification into installed theme.

What sub-theme do is they inherit the parent theme's resources.

You can go through following steps to create sub-theme

https://www.drupal.org/node/225125

I hope this will help
Happy drupalling :)

tenten71’s picture

I'll have to go back and look but I did not mean for anyone to modify an installed theme. The idea is to create your own theme. That is why you need to copy and paste files into a new theme folder.

Sub-themes is another way to go about it but I have never taken that road myself. Not even with WordPress.

knope’s picture

thank you

Zedda’s picture

"You're better off making PHP your friend because Drupal is a bitch."

Right out the box, that's funny. This statement is 100% true - as I forgot my PHP5 book at home today. Argh.

And THANK YOU for writing this. Hats of to you!