Drupal theming - Converting drupal 5x theme to drupal 6x

For converting an existing drupal5 theme to drupal6 theme you can follow these steps:-

=>Create an .info file

Create a themename.info file in your theme directory, which should look something like this:

name = Human-Readable Theme Name
description = One sentence description of theme.
core = 6.x
engine = phptemplate

The core variable should match the value of DRUPAL_CORE_COMPATIBILITY which is defined in modules/system/system.module

2) Get Drupal to notice the theme

If you create the .info file after running update.php, Drupal will not immediately notice that it has been created. Visit admin/build/themes to refresh.

3) Replace variables

Make sure that none of your variables are named $left, $right, or $footer, and then make the following replacements:

  1. $sidebar_left has become $left
  2. $sidebar_right has become $right
  3. $footer_message has become $footer, but when you output it, it should be echo $footer_message . $footer
  4. $language has become $language->language
  5. If you were using $base_path as a link to the front page, you can now use $front_page instead (which contains url(NULL))
  6. if ($messages) print $messages; has become if ($show_messages && $messages) print $messages;

4) Add $signature to comment.tpl.php

Add an echo $signature; after $content is output. The Drupal Handbook also provides a way to avoid double printing signatures on comments created in 5.x and before.

5) Get rid of _phptemplate_callback() if you use it

It is no longer supported.

6) (Optional) Replace theme_some_thing() with some-thing.tpl.php

If your theme's template file defines any mytheme_something() or phptemplate_something() functions, you can optionally remove each of those functions and put its content in a separate .tpl.php file in your theme's directory or any subdirectory thereof. (I think. Still looking into this)

A note about clearing/rebuilding the theme registry

You need to rebuild the theme registry every time a .tpl.php file is created, removed, moved or renamed. You do not need to rebuild the theme registry if the contents of a .tpl.php file changes. To rebuild/clear the theme registry (Drupal 6.0) simply visit or reload the modules page admin/build/modules

7) (Optional) Take advantage of new functionality