Theming - .info file
The dot info file in your theme is the most critical file there is. This file tells Drupal that your theme is there and informs Drupal about the basics of your theme. The naming convention is the name of your folder dot info. If you created a theme, and the directory is called, bluedroptheme, you will need to name your dot info file, bluedroptheme.info
|This site uses the business theme. You can see the folder is named, business, and so is the dot info file. Drupal is harsh when it comes to naming.|
Within your dot info file, there are three required topics that must be included.
name - Name (lowercased) is what is displayed to the administrator. This is what is displayed. The text to the right of the equals sign can be capitalized.
|The highlighted line is the human readable name that appears in Drupal. No quotes are needed.|
description - This what appears on the appearance page.
core - This is the version that can use the theme. If you design it for 7 put 7. You can drill a step lower and put 7.1, but this is never ever done. There is not a theme out that is dependent on a shallow increment of Drupal.
These three items (name, core, and description) are the only required criteria for a theme. Granted, your theme will not do anything, but it is a theme.
What comes next is what makes themes work. These instructions make themes theme. These instructions are listed in array format.
stylesheets - This tells Drupal where your stylesheets are. The format for creating the link to the stylesheets is
stylesheets[all] = stylesheet.css
The [all] is the media attribute that will be placed in the css link. The above refrerence to the stylesheet will translate into HTML as /sites/all/themes/THEMENAME/stylesheet.css
scripts - Scripts is the path to any scripts that your theme will use. Like stylesheets, they are listed in same format:
Both stylesheets and scripts should point to subfolders within your theme!
|Note, the scripts does not need the [all] text.|
Next, come regions. Regions are the divided areas of your page. At this point, you do not need to know your regions. This just identifies them.
Regions must be labeled in the proper way so Drupal can understand them.
regions[THEMEREGION] = Human Terms
All region mark ups in the dot info file begin with the word, region. With in the bracket comes the machine name of the region. This machine name will latter be identified in the tpl pages.
On the right hand side of the equals sign come the human readable verbiage. This is what is displayed on the blocks page.
|Here is an example from the business theme. The content region is very important.|
If you do not set any regions, Drupal will add default regions!
In many themes, you will see features listed. These listed features are not like other Drupal features. These feature statements in the dot info file will allow you create check boxes in your themes configuration.
|These are the features of the business theme.|
In advanced theming, you will be able to add a little php programming and make your feature dynamic. Each of the features will create a variable which is displayed as a check box on the theme's appearance page.
|These are the corresponding featuress listed in the dot info file|
That is the basics of your theme's dot info file!