Presentation on theming available online

Submitted by Marc on Fri, 12/17/2010 - 5:13pm

I have created a site at that delivers a reasonably complete presentation on theming. It even includes a small custom module that illustrates how to create a themable function and a theme that overrides that function.

You may register on the site to view the presentation in your choice of four different themes: Garland, a garland sub-theme, an Andreas03 sub-theme, and a Fusion sub-theme. The Fusion sub-theme implements the theme function override.

What are template files and suggestions?

Submitted by Marc on Wed, 09/22/2010 - 10:59pm

Template files are what Drupal uses to determine how to render the HTML for a page. When you wish to create a custom theme, there are several files you will likely include in your theme's directory:

  • page.tpl.php - this controls the overall look and feel of your site (slight change for Drupal 7). For those of you who have coded sites with HTML (and CSS), this is like the index.html page you created.
  • node.tpl.php - this controls how a node is built

Intro to creating a custom theme

Submitted by Marc on Wed, 09/22/2010 - 10:34pm

There is only one file you must create in order to define your first custom theme: the ".info" file. Create a new subdirectory somewhere under your "sites" directory. For instance, try creating the subdirectory sites/all/themes/mycustomtheme. Inside that subdirectory you can create Note that you do not have to use the same name for the .info file, but it is common practice just to keep things logical.

How to not hack core

Submitted by Marc on Wed, 09/22/2010 - 10:19pm

Okay, so you are ready to start customizing your Drupal installation. Before you get started, there are some things you should know and follow.

  • Drupal provides a directory structure that is designed to be used in a certain way. Notice the subdirectories below your Drupal root:
    • includes
    • misc
    • modules
    • profiles
    • scripts
    • sites
    • themes

Using roles and permissions

Submitted by Marc on Mon, 09/06/2010 - 2:44pm

When you first create your Drupal site, you are asked to supply a user name and password. This first user (User ID 1) is the "root" user. This user has complete control over the site. So, you will want to give this first user a special name like admin, webmaster, or some other such signifier. Don't worry if you have already created this user with another name; you can update this user's name at any point. Just sign in and use the "My account" link from the Navigation menu or go to the path user/1. In general, you don't want to create any content under this profile.

How does Drupal display that set of instructions when I install it?

Submitted by Marc on Fri, 09/03/2010 - 5:40pm

Isn't it nice how Drupal provides a set of instructions on how to get started building your website? And isn't it neat how that disappears as soon as you create a piece of content that is promoted to the front page? To find out how Drupal does this, take a look under the hood by checking out the code at modules/node/node.module in function node_page_default() at line 1775 (as of Drupal 6.19).

The query statement that specifies to look only for content promoted to the front page is at line 1760 and looks like:

Help! I put my site into maintenance mode and signed out.

Submitted by Marc on Wed, 09/01/2010 - 10:20pm

Okay. You finally got the courage to do some upgrades and/or installations of modules on your site and, like a good webmaster, put your site into off-line mode. Then you signed out. Now when you visit your site you get the message that the site is currently off-line.

How are you supposed to get back into the site to put it back online? Actually, it's quite easy. Just point your browser to

That wasn't so bad, was it?