Configuring the Genesis Theme
If you haven't done so already, follow the instructions in Chapter 6 and install the Genesis theme (www.drupal.org/project/genesis). You'll notice that the installation process creates two versions of it: Genesis base and Genesis subtheme. A majority of Drupal starter themes use subthemes as the mechanism for creating a new theme based on the foundation provided by the base theme. This allows you to create one or several new themes using the same underlying foundation without having to start from scratch each time you want to create a new theme. I will follow the Drupal standard approach in this chapter, using the off-the-shelf subtheme that is created by during the Genesis installation process. To create a custom subtheme using the Genesis starter theme, you must follow these steps:
1. Copy the genesis_SUBTHEME directory in the /sites/all/themes/genesis directory to your /sites/all/themes directory.
2. Rename the copied directory to genesis_mytheme (I'll use "mytheme" as the name of the new theme that I am creating).
3. In the /sites/all/themes/mytheme directory, rename the genesis_SUBTHEME.info file to genesis_mytheme.info. The .info file must be named the same as the directory in which it resides.
4. Edit the genesis_mytheme.info file and change the following values:
a. Change the value of name from Genesis SUBTHEME to Genesis mytheme;
b. Change the description of the theme to My Genesis Subtheme.
5. Edit the template.php file. Using search and replace, change every occurrence of genesis_SUBTHEME to genesis_mytheme.
6. Copy the following files from the /sites/all/themes/genesis/templates directory to your /sites/all/themes/genesis_mytheme directory:
|
a. |
page.tpl.php |
|
b. |
node.tpl.php |
|
c. |
block.tpl.php |
|
d. |
field.tpl.php |
|
e. |
region.tpl.php |
|
f. |
comment.tpl.php |
|
g. |
html.tpl.php |
The next step in the process is to enable the Genesis base theme as well as your new Genesis subtheme. Click on the Appearance link in the top menu and scroll down to the "disabled themes" section. You should see three versions of the Genesis theme: base, the off-the-shelf subtheme, and your new derivative of the subtheme named mytheme. Click on the "Enable and set default" link for your new subtheme and return to the home page of your site. Your site should look something close to Figure 13-1.
- Figure 13-1. The standard Genesis theme
The Genesis theme is pretty stark in its out-of-the-box state, but that's a positive aspect of using a starter theme. You have the opportunity to create a theme that displays your site exactly how you want, without trying to make an off-the-shelf theme behave the way you want it to. Next I will show you how to use the Genesis starter theme to create a site that looks like Figure 13-2.
- Figure 13-2. A sample site using the updated theme
Post a comment