Converting a Drupal x Theme to a Drupal x Theme
Drupal themes have changed radically from version 5 to version 6; however, there is no reason to change the design of page that is displayed to Web site visitors when you upgrade the theme from one version of Drupal to another. Keeping this point in mind, you should find it a relatively quick task to upgrade a theme with only a few minor changes to your current theme files. Work through the following checklist to create a Drupal 6 theme:
1. Create an information file for your theme. This file must have the same name as the directory that holds the theme's files and have the extension .info. It must contain the basic information about your theme, including its name, its description, the core version of Drupal the theme can be applied to, and the template engine.
2. Remove "region" definitions from your template.php file. List them in the themeName.info file, instead.
3. Confirm that the variables you have set in your template files match the current default variable names.
4. The phptemplate_callback() function has been replaced by individual tpl.php files. Remove relevant functions from the template.php file and place the themed markup into its corresponding tpl.php file. For example, the contents of phptemplate_breadcrumb() should be placed into the file breadcrumb.tpl.php.
5. Substitute the $layout variable in your template files for $body_classes. Update your CSS files according to the new classes defined. Classes can be used to identify front and internal pages, logged-in users and visitors, node ID and node type, and visible sidebars.
6. The $language variable is now an object. To update your theme, change this variable to $language->language.
7. jQuery version 1.2.3 is now included by default. Scripts can also be placed into a file named script.js for automatic inclusion in the main template for the site.
Keep your files organized
To keep your theme directories clean, place related tpl.php files into relevant subdirectories. If you have a lot of images, you may also want to put them into a subfolder.
Post a comment