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

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[...]
What Your Website Communicates Before Anyone Reads A Word

What Your Website Communicates Before Anyone Reads A Word

Before a visitor reads your headline, clicks your navigation, or scrolls to your services, your website has already made an impression. It has hinted at whether your business feels established or improvised, whether your brand is clear or scattered, and whether you're worth a few more seconds or a quick trip back to the search[...]
Is Lead Generation Worth It for B2B Companies?

Is Lead Generation Worth It for B2B Companies?

Qualified leads are the foundation of B2B revenue, but the cost to generate them keeps climbing. Search competition is stiffer, buyer attention is shorter, and more companies are chasing the same decision-makers. When marketing spend rises and pipeline stays unpredictable, the question of whether lead generation is worth it becomes harder to ignore. For companies[...]
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