Join Class

Drupal Custom Theme Setup

Setting up custom theme in drupal application is one of the very common requirements for any drupal website development, here we see how to change custom theme in drupal application.

How to create new theme in drupal

Step 1:
To create a new theme, we have to create a folder (ex. themeName1) in "themes" folder in following path

In that theme folder we need to add all details of images, files, css files etc. there are some standard format to be followed; we talk about that in details

Change the active theme in the database

The default theme setting is stored in Drupal's database, and thus can be changed by manipulating the database from the command line or an administration overlay or client like PHPMyAdmin or MySQL Workbench for MySQL.

Always make a backup of your database before changing values in it directly, as it is possible to destroy data and render your site unrecoverable at the database level. You have been warned.

Step 1: activate the trusted theme or any theme you have created

# activate a trusted theme
UPDATE system SET status=1 WHERE name = 'garland';

Step 2: change the default setting

# change the default setting
UPDATE variable SET value='s:7:"garland"' WHERE name = 'theme_default';    

Step 3: clear the cache tables

# clear the cache tables
TRUNCATE cache_bootstrap;
TRUNCATE cache_block;

If you want to setup theme for admin (normally not required), update the following table

    UPDATE users SET theme='garland' WHERE uid = '1';

Here are some of the useful post about drupal framework

Drupal Resource Links
Drupal Custom Theme Setting

Learn Drupal Development