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

Insights from the Blueprint Digital team.

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

Food & Beverage Marketing: How Ingredient Buyers Decide

Food & Beverage Marketing: How Ingredient Buyers Decide

Choosing an ingredient supplier is one of the higher-stakes decisions a food or beverage company makes. It runs through several people over a cycle that can stretch for months, and the deciding factor is usually how much risk each option carries for a business that cannot afford a line stoppage or a recall. For marketing[...]
How to Build a B2B Lead Nurturing Program That Closes Deals

How to Build a B2B Lead Nurturing Program That Closes Deals

Most B2B marketing teams are better at generating leads than keeping them warm. A form gets filled out, the lead lands in the CRM, and nothing happens until a salesperson gets around to it, by which point the buyer has moved on or gone quiet. In a market where the average deal takes months of[...]
How We Took the Grind Out of Link Building Prospecting

How We Took the Grind Out of Link Building Prospecting

Most link building programs stall at the same point, the prospecting spreadsheet. Finding sites worth pitching means pulling competitor backlinks, cross-checking them against what you already know, throwing out the junk, and judging what's left for relevance and quality. It's a few hours of repetitive work before a single outreach email gets written, and when[...]
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