Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By RitaJohan on
I would like to make a custom Drupal Theme for me because no theme from the Drupal repository match my needs exactly.
I know the basics of HTML css. But I am new to Drupal.
Please suggest me some tools or any editor better suitable for Drupal.
Comments
How to Make a Custom Drupal Theme
Hi,
All the custom themes should outside the Drupal core themes folder.
First,
1. Create a folder in /sites/all/themes named - "custom" - then open the folder
2. Create a folder in /sites/all/themes/custom named - "newTheme" - then open that folder
3. Now create two files named:
newTheme.info
template.php
4. Create three folders in /sites/all/themes/custom/newTheme - naming them:
CSS
images
templates
5. Open the CSS folder and create a file named style.CSS and go back to the 'newTheme' folder
6. Go into the templates folder and create a file named page.tpl.php
Now you have all the files required to create the theme.
Creating a mock-up
Before begin any coding, create a mock-up design with a vector editor program.
Firstly, go into the newTheme.info file. This file has all the information that Drupal needs to know about the custom theme.
In this file add the following:
name = newTheme
description = A custom template from scratch.
core = 7.x
stylesheets[all][] = CSS/style.CSS
regions[user_menu] = User Menu
regions[main_menu] = Main Menu
regions[content] = Content
** If you want any other regions, you can add to this.
Once you have input those details, close the info file and open the page.tpl.php file located in the templates folder of your 'newTheme' theme folder.
add the absolute minimum to get the page to display data before you add more to it.
Add the following code to the page.tpl.php file and save it.
print render($page['content']);
Note: You must save this as a .php file
Enabling the theme
Now, to enable the theme. Login as an Administrator and click the Appearance link on the top navigation and click on "Enable and set default" for the 'newTheme' theme.
thanks.
I personally recommend
I personally recommend starting with one of the starter themes like omega or zen (among others). With this approach you have a solid starting point without need to learn all the ins and outs of theming.
Hi,
Hi,
I agree with nevets. yes you can create a sub theme from omega or zen or other base theme.
Hello
Hello
You can go with this url for create custom drupal theme Custom Theme.
I hope this url will useful for you.
Raj Laddha
cmsMinds
rajesh@cmsminds.com
Drupal Development - North Carolina