Book Image

Drupal 7 Cookbook

By : Dylan Spencer James
Book Image

Drupal 7 Cookbook

By: Dylan Spencer James

Overview of this book

<p>Drupal 7 is a modern Content Management System famed for its flexibility and power. Using Drupal you can easily create custom functionality that would otherwise have to be purchased in many of the other leading CMSs.<br /><br />"Drupal 7 Cookbook" is filled with recipes to help you to do more with Drupal and improve your skills. Chapters range from content creation, to theming, to managing your site. You will learn how to create your own content types and use them to create Views, Blocks, and Pages. This book will take you from novice to pro in just 12 chapters.<br /><br />In a wide variety of practical recipes, you will learn how to work with views and panels, how to provide translations for your content to create a multilingual site, and to integrate your site with social media. You can develop the Zen starter theme or learn how to create custom cross-browser compatible Drupal themes, including themes for mobile devices. The Drupal 7 Cookbook contains all of the means necessary to take your skills from those of a novice Drupal user to a proficient site builder.</p>
Table of Contents (18 chapters)
Drupal 7 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Adding a new block region to a theme


A Drupal theme defines the structure of the HTML that is output to the screen. It also defines several regions in the HTML structure where blocks can be output, such as Header, Footer, Sidebar first, and so on. This recipe describes how to add your own custom regions to a theme, for situations where the predefined ones do not provide enough flexibility to display your content.

Getting ready

For this recipe, you will need:

  • FTP access to your site and a FTP client such as FileZilla

  • A suitable code editor such as Notepad ++

How to do it...

In this recipe, we will be creating a subtheme based on the Bartik theme, to which we will add the new region. We will be working with a subtheme to avoid updating the Bartik theme directly, as it's not advisable to update any files from the core Drupal files, to prevent problems with overwriting when Drupal is updated.

  1. 1. Working locally, create a folder called bartik_extra.

  2. 2. In your bartik_extra folder, create a new file...