David Slack - Web developer

Drupal theme - Create Folders and Files

First thing we need to do is create the folders for the theme in the correct places then create the files that are needed. So lets start with the main folder. There are a few places to put your theme but we will use the standard so as not to mess up any updates and make the theme easily movable.

We will use the design for Dodgey Daves Discount Emporium so make sure you have the Fireworks png to hand.

  1. Navigate to /sites/all/themes (create the themes folder is you need to)
  2. Create a folder with the name of the theme, ours will be 'dodgy_daves' (don't use spaces or caps)
  3. In the main folder add a 'styles' folder and and 'images' folder
  4. Make sure there is a '/sites/all/fonts' folder which is where we will keep any fonts

Now we have all the folders we need we should create the files

In your main folder '/sites/all/themes/dodgy_daves' create:

  • print.css
  • style.css
  • script.js
  • block.tpl.php
  • comment.tpl.php
  • node.tpl.php
  • page.tpl.php
  • template.php
  • dodgy_daves.info

Make sure all the files are empty. The last file MUST be named the same as the main theme folder with the extension .info, so in this case 'dodgy_daves.info'.

Now we have the files in the correct folders it is good practice to add some info about each file to the top of each file. First we will set up all the php files. Open the 5 php files and at the top add in some info. For block.tpl.php we will use:

<?php

/**
 * block.tpl.php 06/04/2011 for dodgy_dave theme
 * Created by Dave (blah@davidslack.co.uk)
 * Edited on 07/04/2011 by Dave (blah@davidslack.co.uk)
 */

?>

So for each file you have the open and close php tags, a comment with the file name, the date created, the date edited, and who did what. Some systems do this automatically for you but its good practice weather its done manually or automatically.

Now do the rest of the files with the same type of info. .css files use the same comments and so does the .js file so you can use basically the type of thing. However, the .info file needs a ';' infront of each line so use something like:

;
; dodgy_dave.info 06/04/2011 for dodgy_dave theme
; Created by Dave (blah@davidslack.co.uk)
;

 

Comments

Wow! That's a rlealy neat answer!

Think we need some Druapl 7 updates Wink

Hey first off love your theme. Really good job on it and I appreciate the price. I had some trbuloe with the featured area like most people but after reading this, and looking elsewhere, I have succeeded in getting something there at least. My Question is: Is there a special way to make it switch between article features? I can only seem to get 1 up there. Yes I have imputed the category, and yes the cache is set right. Also, is there a way to make the excerpt or wording go below the feature? It just doesn't look that good above and there is no distinction between the article title and the excerpt. They are both the same size, font, and style. Any help would be nice, and my site should be referred to in the above. Thank you in advance for all the help and I hope you don't pass me by. I have bought several themes and wouldn't think twice about making a donation if I can get this the way I want it. Thanks

Dave's picture

Hi Ferna,

Cheers for the compliments, but I'm not sure it applies to my Dodgy Daves theme. This theme is a fake theme to get someone started, not a real theme and I certainly wouldn't sell it!

If you can read the whole tutorial it will simply teach you how to make Drupal 6 Themes

Good luck for the future though

I do websites, me

Add new comment

Latest content

There are lots of developers out there with varying degrees of experience and expertise, some mid level, some junior and some senior. Some...
First thoughts are Symfony is ace!Only been using Symfony for 1 project but the amount of coding it has saved has been worth the time spent...
The Lost and Found website was built by myself (David Slack) and designed by Arm & Eye.The site was created to promote a bar and...

Social networks

Contact me here or catch me on one of
the social networks below


What I'm listening to

My blog

Wednesday, 2 August, 2017 - 06:56
There are lots of developers out there with varying degrees of experience and expertise, some mid level, some junior and some senior. Some developers...
Tuesday, 5 March, 2013 - 09:49
First thoughts are Symfony is ace!Only been using Symfony for 1 project but the amount of coding it has saved has been worth the time spent learning...
Monday, 3 December, 2012 - 10:07
As a web developer and web designer I need to take into account everything on a site from SEO, marketing, usability across devices, the look and feel...

Recent comments

Try this on your mobile

Use your QR reader to read this

You should be able to use this right from the screen

Latest tweets

Calendar

M T W T F S S
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31
 
 
 
 
 

You are here

Back to top

Copyright David Slack - Web developer