1. Web Design
  2. Complete Websites

Implementing a Drupal Business Theme

Read Time:21 minsLanguages:

Having completed our Photoshop design, today we'll look at turning it into a simple Drupal theme. This tutorial will walkthrough basic html/css techniques, a bit of php, creating blocks/views, and I'm also going to explain how to add the Nivo Slider into Drupal!

Step 1: Site Structure

To start off, we're going to use the default Drupal theme "Stark" as our starting point. The Stark theme is located in your Drupal folder > Drupal 7.7 > themes. Go ahead, duplicate Stark, and rename it "Business".

We should have two image files, a .info file, layout css and README file. The only files we need to keep are the screenshot png and, you can delete the rest.

Rename "" to "". This file will contain some basic information about our theme (such as identifying regions and css files) which Drupal needs to know.

Open in the code editor of your choice (I'm using Dreamweaver) and add the following snippet. It lays out the config details, plus the region identifiers, and the various css files we'll be using:

Next we're going to add our template files. We are just going to copy the default examples provided by Drupal and then edit them later. Inside your Drupal 7.7 folder go to modules > system and copy "page.tpl" and "html.tpl" to our business theme folder.

Now create four new folders, "css" for our css files, "design" will contain our psds created in part one of this tutorial, "images" for our images files and "js" for javascript/jQuery files. This is what our basic site structure should look like now:

Next we are going to move our business folder to a better location for Drupal, which is located in sites > all > themes. This is where your default theme will be located when enabled in Drupal.

Step 2: Enable Drupal Theme

Before continuing, make sure Apache and MySQL are running in your XAMPP control panel. Now open https://localhost/drupal-7.7/drupal-7.7/index.php in a web browser and you should be greeted by the default Drupal theme and its interface at the top. To login use your username and password that was created during installation.

Now we are going to enable our business template. Under "Appearance" you should see the Bartik default theme listed and then below that is our theme. Go ahead and set our template as the default theme.

After enabling the theme a success message should appear:

We're now going to edit a few settings for our theme, select the settings link (under our business theme) and copy the settings below. You can also upload the logo from our theme > images folder. Make sure to save the configuration.

After saving the configuration another success message should appear:

Step 3: Drupal Modules

Now we're going to download some Drupal modules to enhance our site. All modules that are installed will be placed in drupal-7.7 > sites > all > modules. Make sure to download modules that are compatible with the version of Drupal that you're using, so in this tutorial only download Drupal 7 modules.

Go to the Drupal modules section to download the required modules for this tutorial:

One more thing we have to do for the CK editor is download some extra files from the CKEditor website. After you've downloaded the file, move it to drupal folder > sites > all > modules > ckeditor-7x-1.3 > ckeditor > ckeditor > ckeditor and extract the files.

Step 4: Enable Modules

Go back to your site and under "modules" select core to minimise that whole section. Now enable the following modules:

  • Under CHAOS TOOL SUITE, enable all modules
  • Under FIELDS, enable link
  • Under MEDIA, enable all modules
  • Under OTHER, enable all modules
  • Under SPAM CONTROL, enable all modules
  • Under USER INTERFACE, enable all modules
  • Under VIEWS, enable all modules

Make sure you save the changes at the bottom of the page.

Step 5: Site Configuration

In this step we will adjust a few important settings for our site. Go to "configuration" and under "System" go to site information. You can change the site name, your email address and the number of posts per page. Under "default front page" clear the form.

Now, under Content Authoring, select "CKEditor", and under "profiles" select "edit" under Full HTML.

Under "File Browser Settings" select "IMCE" in the dropdown menu for File browser type (Link dialog).

Under "Modules" scroll down to "Other" and under the module Pathauto select "configure".

Now change the Default path pattern to "[node:title]".

At the moment the search form is only visible to admin but we also want our users to see it too. To enable the search form go to "People" and under the "Permissions" tab scroll down to "Search" and check all for use search. Again. make sure you save the settings.

To enable the contact form go to "People" and under the "Permissions" tab scroll down to "Contact" and check all for use site wide contact form. Save the settings.

Step 6: HTML Template

Now it's time to edit the HTML in the default Drupal template. Go to your themes folder and open "html.tpl". This file is used to display the basic html structure of a single Drupal page. It includes css files, javascript, jQuery files and our content from the page template we will edit next.

Copy and paste the following html code into the "html.tpl" file.

Step 7: PAGE Template

In this step we will edit the page default Drupal template. Go to your themes folder and open "page.tpl". This file is used to display regions and content.

Copy and paste the following html code into the "page.tpl" file:

Step 8: Blocks Structure

It's time to arrange the blocks in our theme.

Under Structure > Blocks scroll down to "disabled". Now drag the navigation block into the navigation region. Don't forget to save the block at the bottom of the page.

Next go to "add block" and give it a description: "welcome-contact" and in the block body add text: "contact us today". Make sure to select Full HTML in the text format section below the block body.

Select the text and in the editor click the link button. In the popup window, type in the URL: "localhost/drupal-7.7/drupal-7.7/contact".

In region settings under Business theme select Welcome, and save the block.

We will now setup the first column block and after that you can repeat this step twice more for the two other columns.

Add another block, give it a description: "col1" and a title "We get Results".

In the CKEditor select "image" and browse the server to find an icon.

Add in some dummy text and a "read more" link. In the link popup window, type in the URL: "localhost/drupal-7.7/drupal-7.7/services"

In the region settings under Business theme select "Columns". In visibility settings under "Show block on specific pages" check "Only the listed pages" and type "<front>" in the textarea. Now save the block.

Repeat this step two more times for col2 and col3.

Scroll down to disabled and move the search form and user login to the sidebar region.

Scroll down to disabled and move the main menu to the footer region.

Add another block, give it a description: "footer-social". This block will contain our social media icons.

In the block body select "image" and browse server to find the facebook icon. Repeat this step for the twitter and rss icons.

For each image apply a link. In the popup window or source code, type in the URL of the icon (for facebook add: for example.

In region settings under Business theme select "Footer" and save the block.

Add another block, give it a description: "footer-contact".

In the block body type in some copyright text:

In region settings under Business theme select "Footer" and save the block.

OK, after all that, this is how the footer region should look:

Step 9: CSS Reset

You'll hopefully remember that back in Step 1 we referenced a few css files in our "" file. It's time now to create those stylesheets.

Copy and paste the css styles below into a new css file: "reset.css".

Step 9: CSS Layout

Copy and paste the following css styles into a new file: "layout.css". As you would expect, they deal with the layout of our pages, and each section is clearly labeled.

Step 9: CSS HTML Elements

Here we go again - copy and paste the styles below into a new file: "html-elements.css".

Step 9: CSS @font-face

Last one; copy and paste the styles below into a new file: "fonts.css". These styles will sort out our web fonts.

Step 10: Nivo Slider Image Style

We are now going to set-up the Nivo Slider.

Firstly we'll set-up an image style that will define the height and width of our slider images. Under "configuration", scroll down to "media" and under "image styles" select "add an Image style".

Add a style and call it "slider". Scroll down to "Effect" then in the drop down menu select "scale and crop". Then select add.

Here we are going to set the dimensions of our slider image. Add in 940px width and 320px height and add that effect.

The final result:

Now exit that screen and our style should be added to the bottom on this page:

Step 10: Nivo Slider Content Type

Now we have to add a content type to post our slider images under. Under Structure > Content types, select "add content type".

Give it a name, Slider (add a description if you want) and edit the settings as follows:

  • Submission form: default
  • Publish: only published checked
  • Display settings: uncheck
  • Comment settings: drop down > closed
  • Menu settings: none

Now select "save and add fields".

On the next screen, go ahead and delete the body field because we don't need it. Add a new field Link with the following settings:

  • label: Link
  • field name: field_link
  • data store: Link
  • widget: Link

Select save and then Save the field settings on the following screen.

On the next page we'll just save the default settings.

Go ahead and add another new field called "Image" with these settings:

  • label: Image
  • field name: field_pic
  • data store: Image
  • widget: Image

Select save and then Save the field settings on the next screen. On the next page, under "preview image style" select "slider" (the image style we created earlier).

This success message should appear:

Step 10: Nivo Slider Add Content

In this section we will add some slider images using our content type created earlier. Under Content go to "add content":

You should see "Slider" under our two default content types.

Click on slider and add a title. I'm just going to upload a large image from my documents. Make sure you select "upload and save" at the bottom.

Repeat that step a few times so we have enough images for the slider to scroll through.

Step 10: Nivo Slider Add View

Now we will add a view. Under Structure select "views".

Select add new view and copy the settings below:

Select "Continue and edit".

Under Format > Unformatted list change the display to "Views Nivo Slider". Select "apply".

Under "Image field style" select "slider", under "Direction Navigator Hide" select "No", under "Control Navigator" select "Basic" and apply all displays.

Under Fields remove the default field Title.

Now add a new field and on the next screen search for Link and select "Link appears in node:slider". Apply configure fields.

Check "exclude from display" and apply settings.

Under Fields add another a new field. Search for image and select "Image appears in node:slider". Apply configure fields

Under "Image style" choose "slider" and under "Link image to", choose "content". Apply the settings.

Make sure you save the view at the top of the page.

If you view your site now nothing will have changed because we have to assign the view to a block, which we will do in the next step!

Step 10: Nivo Slider Enable Slider

In this step we will give our slider a block. This is so we can adjust it to only appear on the homepage.

Under structure > blocks if you scroll down to the disabled section you should see "View: Slider". Go ahead and drag it to our featured block. Make sure you save blocks at the bottom.

Now if you view your site the slider should be transitioning through our images! You may have to refresh your browser or clear Drupal's cache if it doesn't show up, if so under configuration > development select "performance"S and clear the cache.

Next we will hide the featured block so it only appears on the homepage.

Under Structure > blocks scroll down to "featured" and for the view:slider block select "configure".

Scroll down to Show block on specific pages and check "Only the listed pages". In the textarea type in "<front>" and save the block.

Step 10: Nivo Slider Style the Slider

To edit the default Nivo Slider styles we are going to edit the css file in the nivo slider folder. In your Drupal folder go to "sites > all > modules > views_nivo_slider-7.x-2.x-dev > views_nivo_slider > styles > default" and open custom-nivo-slider.css in your code editor.

Copy and paste the css styles below into "custom-nivo-slider.css".

Also, replace the default arrows and bullet images with the ones we created in part one.

Step 11: Add Pages

To create a new page, go to "add content" on your dashboard and select the content type: basic page.

Give the page a title and add some dummy text in the textarea.

Scroll down to "menu settings" and check "provide a menu link". Give a description, parent item should be "main menu", and give it a weight of 1.

Step 12: Contact Form

To enable the contact form go to modules and in the Core section you should find the contact module which is disabled by default. Go ahead and enable the contact module. Save configuration.

Now under the contact module go to "configure" and on the next screen select the link: Menus administration page.

Under the navigation menu go to list links and enable the contact link. Now under the contact link go to "edit".

Change parent link to main menu and give it a weight of 4.

Now you should have a working contact form on the contact page!


It's been a pretty involved walk-through, but I hope it's given you an idea of how to lay out, design, and set up a drupal theme. Once you have this example up and running, you'll be able to move on to more advanced theming.

I hope you liked this tutorial, thanks for reading!

Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.