Skip to content
Home Blog Web Development Looking into Drupal theme .info files

Looking into Drupal theme .info files

  • Web Development
Blueprint Digital
Blueprint Digital

Last week, I wrote about getting familiar with Drupal themes and how they are set up. This week’s post is going to be all about the .info files in Drupal themes.

The .info files are a crucial part of Drupal themes. The .info file in a Drupal theme configures the theme. Let’s look at an example of what you might find in an .info file:

name = Garland
description = Tableless, recolorable, multi-column, fluid width theme (default).
version = VERSION
core = 6.x
engine = phptemplate
stylesheets[all][] = style.css
stylesheets[print][] = print.css

The .info file contains the theme information and also the files associated with the theme. For example, you can see style.css and print.css listed above.

Another cool thing you can do with embedding stylesheets in the .info file is that you can set CSS media queries in the .info file. All you need to do is, instead of having stylesheets[all][], have something like stylesheets[screen and (max-width: 480px)][].

There are some required information that needs to be in every Drupal .info file:

  • name – This is the human-friendly name that will be displayed on the theme select page.
  • description (recommended) – This is a short description of the theme that helps identifying it on the theme select page.
  • core – Each .info file should state which major core version of Drupal it is compatible with to avoid compatibility issues.
  • engine – This is the Drupal theme engine, and it is usually phptemplate. In Drupal 7, you don’t need to have this line.

Regions

In Drupal, there are these things called block regions, which are kind of like WordPress dynamic sidebars. Block regions are dynamic content areas that could hold different content (block) that you can set through the Drupal administrator dashboard. The important thing is, these regions are set in the .info file of a Drupal theme.

regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer

The above is a list of default regions in Drupal 6. To use those regions in the theme’s page.tpl.php file, all you need to do is something similar to this:

/* Display blocks in "Left sidebar" */
<?php print $left; ?>

Conclusion

Drupal theme development can seem complicated at first, but learning about Drupal themes in general and learning about what each file does can help set you on the right direction to becoming a Drupal developer.

Ready to Dominate Online and Grow Your Business?

Schedule time to connect with Blueprint about your online goals, or request a free review of marketing campaigns.

Related Posts

The B2B Lead Generation Funnel: From First Touch to Closed Deal

The B2B Lead Generation Funnel: From First Touch to Closed Deal

Most B2B marketing teams can generate leads. Fewer can predict them. The month a big trade show or a strong campaign lands, the pipeline looks healthy; through the quiet months that follow, sales starts asking where the opportunities went. The difference between a lucky pipeline and a predictable one is whether you treat lead generation[...]
Creating Better and Faster Landing Pages with AI

Creating Better and Faster Landing Pages with AI

Landing pages have always been one of the most important assets in a performance marketing program. They can support SEO campaigns, email campaigns, sales enablement, product launches, event promotion, and plenty of other initiatives. But for teams focused on paid media and lead generation, landing pages carry even more weight because they often determine whether[...]
What Makes a Great Website Design for Healthcare Providers?

What Makes a Great Website Design for Healthcare Providers?

A visitor forms a first judgment about a website in about 50 milliseconds. For a healthcare practice, that split second carries more weight than it does almost anywhere else, because the people arriving are rarely in a casual mood. Most have already met the practice online before they ever meet the provider, comparing options and[...]
Previous
Next

Partner with BLUEPRINT to reach your online goals, grow your business and reshape your story.

Get in touch with BLUEPRINT

Reach out to request a discovery call, a free campaign review, or for all other inquiries.

Subscribe to our newsletter