Subtheming quickstart
Steps to create a custom Fusion subtheme
- Copy the fusion_starter folder from Fusion and rename to the name of your choice (eg. “mysite_theme”)
- Rename the .info file to the same name you just gave the folder
- Open the .info file and give your theme a more descriptive name and full description here. This will enable you to find it more easily on your theme list in the user interface.
- On this line
stylesheets[all][] = css/fusion-starter-style.css, replace the “fusion-starter” part with your theme’s name - Rename the css file in the css/ folder to match
- Upload to your site and enable your new theme on admin/build/themes!
Comparison of Fusion starter themes

Currently there are two ‘starter’ subthemes available for Fusion: Fusion Starter and Fusion Starter Lite. Which one should you choose when creating your own custom subtheme? Well, that depends!
If you have no idea what any of this means and want something simple to start with – go for the Lite version. Similarly, if you’re an advanced themer and know what you’re doing, and only want to include parts of Fusion as you need it, start with Lite.
If you want to see all the bells and whistles of what Fusion can do, go with Fusion Starter!
Of course in reality this is a continuum, and the list below just reflects the out-of-the-box defaults in each. You can always start with Lite and copy additional settings from Starter as needed, or remove code from Starter.
Here are the differences between the two:
| Fusion Starter | Fusion Starter Lite |
|---|---|
| 14 regions | 5 regions |
| 16 column grid default | 12 column grid default |
| Wrappers on all rows for full width background styling | No wrappers on rows |
| Includes extensive starter CSS | Minimal starter CSS |
| Includes Ubercart starter CSS | No Ubercart starter CSS |
| Inherits all Fusion Core’s Skinr styles | Does not inherit Fusion Core’s Skinr styles (other than block widths & position) |
| Files included: see screenshot (inherits most from Fusion Core) | Files included: see screenshot (less files, but also includes block.tpl.php and page.tpl.php to override Fusion Core’s) |
Deconstructing your info file
Your Fusion sub-theme’s info file does some important things, such as define regions, Skinr styles, and theme defaults. Here we’ll break down the various sections of the .info file and explain what’s happening under the hood.
name = Fusion Starter
description = Fusion Starter sub-theme for Drupal 6.
base theme = fusion_core
core = 6.x
engine = phptemplateYou’re probably not changing anything here other than the name and description to match your custom sub-theme.
stylesheets[all][] = css/fusion-starter-style.css
The path to your sub-theme’s main CSS file. They are in a separate folder to keep things tidy. You can also add other CSS files here if you prefer to divide them further.
regions[sidebar_first] = sidebar first
regions[sidebar_last] = sidebar last
regions[header_top] = header top
regions[header] = header
regions[preface_top] = preface top
regions[preface_bottom] = preface bottom
regions[content_top] = content top
regions[content] = content
regions[content_bottom] = content bottom
regions[postscript_top] = postscript top
regions[postscript_bottom] = postscript bottom
regions[footer] = footer
regions[node_top] = node top
regions[node_bottom] = node bottomAll the regions from Fusion Core. Unfortunately sub-theme inheritance is a bit broken in Drupal 6, so we have to duplicate all the available regions here. If you want to add or remove regions listed here, you’ll need to remove them from the info, plus copy over the page.tpl.php from Fusion Core and make your changes in the sub-theme’s copy of page.tpl.php.
features[] = logo
features[] = name
features[] = slogan
features[] = node_user_picture
features[] = comment_user_picture
features[] = search
features[] = favicon
features[] = primary_links
features[] = secondary_linksThese are Drupal’s standard theme settings. We’re copying them into the sub-theme’s info file because Fusion does not natively support the mission statement setting, in favor of the Drupal 7-esque approach of simply using a block/region for this. In Drupal 6, if you use a set of features other than the full range of defaults, these are not inherited from the base theme.
; Default theme settings
settings[theme_grid] = grid16-960
settings[fluid_grid_width] = fluid-100
settings[theme_font_size] = font-size-12
settings[sidebar_layout] = sidebars-split
settings[sidebar_first_width] = 3
settings[sidebar_last_width] = 3This is where things get interesting! These are the theme settings defaults for Fusion’s own theme settings for layout and font sizes. They can be overridden using the theme configuration settings, but a default should be set for your sub-theme. The full range of possible default values can be found below.
; Inherit Skinr styles from Fusion Core
skinr[options][inherit_skins] = trueThis line simply tells your sub-theme to also use all the Skinr styles from Fusion Core, such as block widths, alignment, and menu styles.
; Sample Skinr style (uncomment to use, see Skinr section in CSS)
;skinr[fusion-example-styles][title] = Sample Skinr block styles
;skinr[fusion-example-styles][type] = checkboxes
;skinr[fusion-example-styles][features][] = block
;skinr[fusion-example-styles][options][1][label] = My sample Skinr style
;skinr[fusion-example-styles][options][1][class] = fusion-example-stylenameThis is meant to get you started writing your first custom Skinr style for Fusion. More information on this is in the other sections of this theme developer handbook.
Overriding template files to edit markup
Sometimes you need to override a template (tpl) file in your theme to add the content or styling you need if it is not a change that can be made in pure CSS.
For example, we want to add the number of comments next to the title of the comments area so it looks like “4 Comments” rather than just reading “Comments”.
We need to override the contents of the “comment-wrapper.tpl.php” file that came with your Fusion based theme. If no such file came with your sub theme, you can copy the original copy of it from the Fusion Core theme folder to your sub theme’s folder. Open the newly added or existing “comment-wrapper.tpl.php” file and replace the code within it with this:
<?php if ($content) : ?>
<div id="comments" class="comments block">
<h2 class="comments-header">
<?php print $node->comment_count ?> <?php print t('Comments'); ?>
</h2>
<?php print $content; ?>
</div>
<?php endif; ?>What we’re doing there is saying: if there are comments, show the comment count next to the text “Comments”. So if there are four comments, the title for the comments are will read “4 Comments” rather than just “Comments”.
Remember that after making changes to an existing *.tpl.php file or adding a new *.tpl.php file, you need to clear the site cache on the Performance page. That reloads the theme’s files and loads the changes that have been made.
Other template files
The same idea applies to changes made to theme files such as the “block.tpl.php”, “node.tpl.php”, and the “page.tpl.php”. Not all sub themes come with these files so if you need to make changes to these files but they don’t exist, you can copy them over from the Fusion Core theme’s folder to your sub theme’s folder. Since all Fusion based sub themes use the Fusion Core *.tpl.php files this is a safe method at making such changes without altering Fusion Core.
Of course Fusion doesn’t include all possible template files, so you can add any tpl files from Drupal itself or various modules by copying these from the original folder into your sub theme’s folder.
template.php
To add template.php code, simply create a new template.php file in your sub theme and add the necessary code. It will automatically run Fusion’s template.php file as well.
Rearranging elements of the page
Sometimes the design of a site has a different layout than the default for a Fusion sub theme. Commonly we need to add a wrapper around several sections of the page, or rearrange the content in the header or footer.
Moving the primary menu
For example, you might want the primary menu to be full width and to appear above the logo and search box in the header area. That specific layout would require changes to the “page.tpl.php” file for your sub theme. If your sub theme does not have a “page.tpl.php” file, you can copy the one from Fusion Core’s theme folder to your sub theme’s folder and use that one.
Now that you have a “page.tpl.php” file in your sub theme’s directory, we can start making some changes to the header. By default the primary menu loads after the logo, site name, search box, header regions etc. in the header group. Since we want to move the primary menu above the logo and site name we need to locate the primary menu code and move it so it loads before them in the “page.tpl.php” file.
<?php print theme('grid_block', $primary_links_tree, 'primary-menu'); ?>
Once we have located the code that prints the primary menu on the page we need to move it up in the source order. Cut that code above and paste it somewhere else in the “page.tpl.php” file, just above the #header-group-wrapper div.
It should look something like this:
<?php print theme('grid_row', $header_top, 'header-top', 'full-width', $grid_width); ?>
<?php print theme('grid_block', $primary_links_tree, 'primary-menu'); ?>
<div id="header-group-wrapper" class="header-group-wrapper full-width">
<?php print theme('grid_block', $primary_links_tree, 'primary-menu'); ?>Now, we’re also going to change the primary menu from being a grid_block to a grid_row. This will cause the primary menu to take up a full row and have an extra wrapper div for full width styling.
<?php print theme('grid_row', $primary_links_tree, 'primary-menu', 'full-width', $grid_width); ?>
Once you have saved the changes, go back to your Drupal site and clear the site’s cache on the Performance page. That will reload the theme files and should show the primary menu in a different location now. You will only have to clear the site cache once after making these changes but you will need to refresh your browser with each change to see the changes on the site.
If your changes are complete and everything is in the correct location, then you can go ahead with CSS styling to get the look you want!
Easy CSS theming with body classes
There are quite a few body classes that are added to the theme based one what content is present and the configuration of your site. These are very helpful when you want to change a specific element on a specific page.
When viewing a page take a look at the HTML source it generates. You should see a bit of HTML like this for the body id/class.
<body id="pid-node-94" class="not-front logged-in page-node node-type-blog full-node layout-first-main-last sidebars-split grid-type-960 grid-width-16">Each piece of that HTML is dynamically generated based on the content that is presented on the current page as well as the layout configuration. Let’s break down each element of the HTML above so we know what is going on with this page.
body id=”pid-node-94”
This is a dynamically created page id based on the node id of this specific page. Judging by the body id here we can also tell that the URL to access this node is /node/94 as “pid” is short for “page id” and “node-94” is the same as the URL of ”/node/94”.
class=”not-front”
This is saying that we are not on the front page.
class=”logged-in”
This is saying that we are currently logged in to the site.
class=”page-node”
We are currently on a node page. If we were on the /admin page it would read “page-admin” instead.
class=”node-type-blog”
This is saying that the node type being viewed is a Blog. If we were viewing a Story node it would read “node-type-story” instead.
class=”full-node”
We are currently viewing a full node rather than a teaser listing.
class=”layout-first-main-last”
This means that the current layout is set up so there are three columns including the “Sidebar first”, “Main”, and “Sidebar last”. There are four options for column layouts with a Fusion based theme.
Options include no sidebars and just one main column “layout-main”, sidebar first and then main “layout-first-main”, main and then sidebar last “layout-main-last”, and then all three columns sidebar first and main and sidebar last “layout-first-main-last”.
class=”sidebars-split”
This means that the current layout has split sidebars. Meaning that the sidebars are not next to each other. The layout would be a three column layout with sidebars on the two outside columns and the main content area in the middle.
Other options are both sidebars first “sidebars-first” or both sidebars last “sidebars-last”.
class=”grid-type-960”
This is the default grid type with a width of 960. You can add your own grid layout to your Fusion sub theme and this is where it is stating which grid is currently being used.
class=”grid-width-16”
By default Fusion Core supports the 16 grid width as well as the 12 grid width layout. In your sub theme you can manually specify which grid to use.
class=”panels”
Not shown in the example above, but a panels class will be added when you’re on a Panels-enabled page.
Styling with body classes
Say you want to change the border color for the teaser on the homepage in the main content area only:
.front .content-inner .teaser { border-bottom: 1px solid #000; }That would set the bottom border on the homepage teaser in the main content area to black. All other pages would be unaffected as we are using the body classes given to us by the theme to add a bottom border to the teaser listing on the front page only.
General Theming Features for Block Classes
Theming block specific elements is quite easy once you know the HTML output that the block and its elements contain. For example, we want to add alternating background colors to a block that has been created with Views. The View is a list of recent blog posts and there are even and odd classes applied to the list items. To style them we would use something like the following:
#block-views-Products-block_1 .views li.views-row-odd { background: #ccc; }
#block-views-Products-block_1 .views li.views-row-even { background: #ddd; }
That would set the odd list items background to #ccc and the even list items background to #ddd. Notice that the specific view is targeted by using its id of “#block-views-Products-block_1”. That helps us make sure we are not altering any other block on the site, just this specific one. You can also get an idea of the block id by viewing the Theme: Information link in the Views UI. The template suggestion names often contain a block id, such as views-view–block-1.tpl.php. Views template suggestions go from generic (target everything like this) to extremely specific (target one particular item in one section of a specific view), so be careful when choosing your classes.
