Skip to: Site menu | Main content

theming

Presentation on theming available online

I have created a site at http://theming.isaacsonwebdevelopment.com 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?

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

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 mycustomtheme.info. 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.

Credits: XWeb | Chris Herberte | Andreas Viklund