Creating a Garland sub-theme and enabling the Color module

For this site, I've been using Minnelli - a fixed-width version of Drupal 6's default Garland theme - along with the Color module to change the site's default colour set to Bluemarine as oppose to the standard Blue Lagoon.

Recently, I decided that I wanted to edit the page.tpl.php and node.tpl.php template files, but as I was using a core theme, I wasn't able to change these files. So, I created a copy of the Minelli theme directory, renamed it, and placed it into my sites/all/themes directory. As with the default Minnelli theme, my copied theme would need to use Garland as a base theme, to do this, I added the following code to its .info file:

base theme = garland

Click here for more information on sub-themes.

The .info file

To allow the Color module to work with this theme, the 'Color' directory needs to be copied as part of the Minnelli theme. Once this was copied, I was able to visit admin/build/themes/settings/mytheme to configure its settings.

However, when I attempted to apply my new colour set, 4 error messages were being displayed telling me that files could not be copied as no file with that name existed. When I looked into it, the files that were missing were images contained within a seperate folder. I opened the color.inc file, and instead of changing the paths and values within it, I decided to find an alternative solution.

Error messages.

My solution was to remove the copied folder, and to create symlinks instead.

Opening a terminal window, I created symlinks to the original color and images directories within the Garland theme folder, as well as Garland's style.css file.

ln -s ../../../../themes/garland/color color
ln -s ../../../../themes/garland/images images
ln -s ../../../../themes/garland/style.css style.css

Creating symlinks in Terminal.

Symbolic links.

With these links created, my new theme could reference the original directories and files within the Garland folder, and apply my new theme configuration settings.

Share this