We always design our websites with your future success in mind, carefully planning and optimizing all content to ensure maximum visibility and long-term profitability

Most Important Points To Remember When You Make A Drupal Theme

make a drupal themeDrupal themes allow you to alter the look and feel of your site so that it’s pretty much 100% original. After all, we don’t want to get stuck with a website that looks the same as everyone else’s, do we? Mastering Drupal theme development allows you to create a website that stands out from the crowd. But when making a Drupal theme, there might be a few things you may have missed. We’re going to take a look at a few important points you need to bear in mind when you make a Drupal theme.

The Theme Folder Structure

Perhaps the most important thing you need some knowledge of Drupal 7’s folder structure.

All the core themes are placed in the themes directory of the root folder.

If you have any extra themes on your hand, you should slot them into the sites/all/themes directory. And if you download any new themes, it is recommended that you import them into a separate folder altogether.

Overview Of Your Theme Files

Drupal 7 requires a few files for the creation of a theme. Altogether, the files are a mixed bag of PHP script, one text files, Javascript and CSS files.

The only that you fundamentally need is the .info file. That said, the CSS file is also a prerequisite. Without it, your site will basically look like a 4 year-old child has taken your text and images and thrown them together onto a blank canvas!

Here is a list of the files that a theme typically contains when you make a Drupal theme:

  • .info
  • html.tpl.php
  • page.tpl.php
  • style.css
  • node.tpl.php
  • block.tpl.php
  • comment.tpl.php
  • template.php
  • theme-settings.php
  • logo.png
  • screenshot.png

You Need Some Knowledge When Making A Drupal Theme

Making a Drupal theme is often no where near as difficult as a lot of people assume it to be. With that said, it also isn’t as simple as some expert coders would have you believe.

The truth is that you can make a Drupal theme by reading a theme development tutorial such as the ones found on our website; but you do also need some prior knowledge of HTML,CSS and PHP. It’s not essential that you’re a pro, but it does help if you have some knowledge.

Template Files

Drupal 7 contains lots of template files, and they’re all collected together for the core Drupal installation. Most of your HTML is defined here and they’re really easy to find – they end with the extension tpl.php.

You can override all the template files simply by adding a new file with the same name.

You need multiple template files to build a page. These include:

  • html.tpl.php
  • page.tpl.php
  • block.tpl.php
  • node.tpl.php

Before you do anything, you need to generate a file named template.php. From here, you can add any theme function.

We’ve covered a few pointers you need to remember when making a Drupal custom theme development. For more in-depth coverage of Drupal theme creation, take a look at out other tutorials on this site.

Comments are closed.