A info File

The next thing our new Descartes theme needs is a .info file. This file provides Drupal with information about the theme. Some of that information is simply used for display, while other directives provide Drupal with information necessary for serving and executing the theme code.

Just as with a module's .info file, this file should be named with the machine-readable name of the theme. Thus, our file is named descartes.info.

Also like the module's .info file, this file is in the PHP configuration format, and it has many of the same directives.

Here is our theme configuration file:

name = Descartes description = Table-based multi-column theme with a Cartesian flavor. version = 1.0 core = 6.x base theme = bluemarine

There is very little to note in this simple file. The first four fields function in the same capacity for themes as they do for modules.

The name field should contain the user-friendly title of the theme, and the description should provide a one-line description of the theme. Likewise, version should give the version number of the theme.

The most interesting directive, though, is the base theme directive. This tells Drupal that this theme makes use of resources from another theme — the bluemarine theme. It is this directive that effectively makes this a sub-theme of Bluemarine. The name passed to the base theme directive must be the machine-readable name.

That's all there is to our first theme .info file. There are, of course, many other directives that can be used in a theme's .info file. We will look at a few more of these later in the chapter. A complete list is available at: http://drupal.org/ node/137062.

Now we are ready to create a custom stylesheet.

0 0

Post a comment