Book Image

Drupal 6 Themes

By : Ric Shreves
Book Image

Drupal 6 Themes

By: Ric Shreves

Overview of this book

<p>Drupal is an award winning open source Content Management System (CMS). Based on PHP/MySQL, its power and flexibility combined with its exceptional design mean it is one of the most popular choices for creating a CMS website.<br /><br />Drupal employs a specialized templating system and supports themes, which allow you to change the look and feel of the system's front and back-end interfaces. <br /><br />Drupal 6 Themes is an ideal introduction to theming with Drupal 6. If you want to create a striking new look for your Drupal 6 website, this book is for you. This book is a revised, updated and expanded edition of Drupal 5 Themes, written specifically for Drupal 6. The book will show you techniques and tools to help you improve the look and feel of any Drupal 6-powered website<br /><br />Starting from the basics of theme setup and configuration, you will learn about the Drupal theming architecture and the PHPTemplate engine, and then move on to modifying existing themes and building new themes from scratch. You will find out about tools to make your theme development easier, and also find invaluable information about under-documented elements of the theming system.</p>
Table of Contents (16 chapters)
Drupal 6 Themes
Credits
About the Author
About the Reviewers
Preface

Appendix A. Drupal CSS Map

All of the HTML output in Drupal comes from various functions, many of which are themable. The styling of the output is controlled by various stylesheets. Accordingly, one of the keys to controlling your site’s look and feel is having a good command of the stylesheets.

The Drupal system contains a large number of stylesheets. In this chapter, we’ll take you on a guided tour of all the various stylesheets.

A Guide to Drupal Stylesheets

A typical Drupal installation will include more than forty stylesheets, and may also include a certain number of embedded styles. If you have installed additional extensions, you may well find that they come with their own stylesheets, pushing the count up even higher.

The Drupal approach to stylesheets may initially appear to be overkill in the extreme, or at the very least a rather literal application of modularization, but there is a method behind this madness. The use of multiple stylesheets not only makes it easier for the individual module maintainers of the Drupal development team, but also helps you find what you need more quickly than having to deal with one or two massive files. The net result is an approach that is actually quite effective—once you get past the initial shock!

In order to reduce the potential threats of conflicting stylesheets and absurd loading times, Drupal provides a CSS pre-processing engine. This engine identifies the required stylesheets, strips out the line breaks and spaces from all the files, and delivers the styles in a combined single file. The use of this feature is disabled by default; if you wish to use it, you must access Administer | Site configuration | Performance and enable the Bandwidth optimization option labeled Aggregate and compress CSS files.

Note

While working on the themes of your Drupal site, you should make sure the CSS compression is disabled. If the compression is enabled, you may not be able to immediately see the impact of changes to your site’s CSS.

In the section below, we list the default Drupal stylesheets, where they are found, and briefly explain their function.

admin.css

/modules/system

Concerns the admin system interface, status reports, and theme configuration.

admin-rtl.css

/modules/system

Additional styles needed for proper display in character sets that read right-to-left.

aggregator.css

/modules/aggregator

Affects the RSS/Newsfeed Aggregator Module and its contents.

aggregator-rtl.css

/modules/aggregator

Additional styles needed for proper display in character sets that read right-to-left.

block.css

/modules/block

Controls Block formatting.

book.css

/modules/book

Controls the formatting of Book node content.

book-rtl.css

/modules/book

Additional styles needed for proper display in character sets that read right-to-left.

color.css

/modules/color

Controls the Color module used with some themes.

color-rtl.css

/modules/color

Additional styles needed for proper display in character sets that read right-to-left.

comment.css

/modules/comment

Provides the indent style for Comments.

comment-rtl.css

/modules/comment

Additional styles needed for proper display in character sets that read right-to-left.

dblog.css

/modules/dblog

Styles related to the display of the DB Log functionality.

dblog-rtl.css

/modules/dblog

Additional styles needed for proper display in character sets that read right-to-left.

defaults.css

/modules/system

Provides styling for basic default HTML elements used throughout the system.

defaults-rtl.css

/modules/system

Additional styles needed for proper display in character sets that read right-to-left.

forum.css

/modules/forum

Affects the contents of the Forum module.

forum-rtl.css

/modules/forum

Additional styles needed for proper display in character sets that read right-to-left.

help.css

/modules/help

Styles Help items.

help-rtl.css

/modules/help

Additional styles needed for proper display in character sets that read right-to-left.

locale.css

/modules/locale

Provides a selector for the Locale module.

maintenance.css

/modules/system

Provides styling for the Maintenance page. This controls the "site offline" page.

node.css

/modules/node

Provides selectors for Nodes.

node-rtl.css

/modules/node

Additional styles needed for proper display in character sets that read right-to-left.

openid.css

/modules/openid

Styling for the OpenID module.

poll.css

/modules/poll

Styling for Polls.

poll-rtl.css

/modules/poll

Additional styles needed for proper display in character sets that read right-to-left.

profile.css

/modules/profile

Styling for the Profile module.

search.css

/modules/search

Styling for the Search module.

search-rtl.css

/modules/search

Additional styles needed for proper display in character sets that read right-to-left.

style.css

Theme-specific styles—located in the theme directory. This is the most critical file in a PHPTemplate theme and is the highest in the order of precedence; styles placed here will override conflicting selectors located in any other default CSS file. See the end of this Appendix for a listing of the stylesheets for the themes included in the default distribution.

system.css

/modules/system

Covers a wide variety of common styles, and also includes menus, tabs, and progress bars.

system-rtl.css

/modules/system

Additional styles needed for proper display in character sets that read right-to-left.

system-menus.css

/modules/system

Provides the styling for the menus in the admin system.

system-menus-rtl.css

/modules/system

Additional styles needed for proper display in character sets that read right-to-left.

taxonomy.css

/modules/taxonomy

Styles used by the Taxonomy module.

tracker.css

/modules/tracker

Table styles used by the Tracker module.

update.css

/modules/update

Styles necessary for the Update module.

update-rtl.css

/modules/update

Additional styles needed for proper display in character sets that read right-to-left.

user.css

/modules/user

Styles for the User module and Profile module; includes styles for user administration.

user-rtl.css

/modules/user

Additional styles needed for proper display in character sets that read right-to-left.