CHAPTER 5 ADDING AND CUSTOMIZING THEMES 153 (Web server certificate)
CHAPTER 5 ADDING AND CUSTOMIZING THEMES 153 How Drupal Finds Themes Whenever you visit the theme administration page (admin/themes), Drupal looks to see which themes are available and lists them for you. This is a four-step process, which is important to be aware of if you are interested in modifying existing themes or making new themes: 1. Drupal looks for pure themes like Chameleon by searching for subdirectories of themes that contain a name.themefile. It expects that the name of the theme will match the directory in which it is found, so chameleon.themeshould be found in the themes/chameleon folder, for example. Each pure theme is added to the list of themes. 2. Drupal determines which engines are available by looking for files with the .engine suffix in subdirectories of the themes/engines directory. These engines are given the responsibility of determining which templates fall under their control. A list of theme engines is made. 3. Drupal asks each engine to identify themes belonging to it. PHPTemplate accomplishes this by looking for subdirectories of themes that have a page.tpl.php file in them. The presence of this file is the only requirement of a PHPTemplate theme, and you could conceivably make a theme with nothing but page.tpl.php. Each theme engine then returns a list of themes under its control, and these are added to the list of themes. 4. Finally, there are CSS-only themes, called styles, which consist of nothing but a style sheet that is applied to an existing template or theme. For this, Drupal looks for files called style.css in subdirectories of known themes. Each style.css that is found behaves as an alternate style sheet that is applied to the HTML of the parent theme (in whose folder it resides). The list of styles is then added to the list of themes, which is now complete. Table 5-1 shows the makeup of the default themes. Table 5-1. Components of the Core Themes Theme Engine Templates CSS Bluemarine Pushbutton phptemplate.engine *.tpl.php themes/bluemarine/style.css themes/pushbutton/styles.css Chameleon Marvin chameleon.theme chameleon.theme themes/chameleon/style.css themes/chameleon/marvin/style.css Figure 5-5 shows all of the theme-related files that are delivered with Drupal and their relationships based on Table 5-1. You will notice how the Marvin style exists as a subdirectory in the Chameleon theme and consists of only a style sheet. This figure also shows the default *.tpl.php template files in the phptemplate directory. These templates affect all PHPTemplate themes, unless they are specifically overridden within the themes themselves. Details on overriding templates and creating CSS-only themes (styles) are provided in the Customizing Themes section later in this chapter.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services