Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Drupal 5 Themes

You're reading from   Drupal 5 Themes Create a new theme for your Drupal website with a clean layout and powerful CSS styling

Arrow left icon
Product type Paperback
Published in Dec 2007
Publisher Packt
ISBN-13 9781847191823
Length 260 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Toc

The Big Picture: How Drupal Displays a Page


In order to appreciate fully the philosophy behind theming and the rationale behind the approach to modifying and creating themes that is presented in this text, it is useful to see how Drupal functions at run time.

The shortest explanation of how a CMS functions can be expressed as follows: Text and pointers to other kinds of content are stored in the database; that data is then dynamically retrieved, composed, and presented to a user in response to a request sent from a web browser. Drupal functions in the same manner, with the themes playing the crucial role in the formatting and presentation of the contents.

To illustrate the topic in more detail, consider the following:

The diagram shows a hierarchy, wherein the lowest level is the raw data and the highest level is the final output displayed on the page. The diagram also shows an order of precedence in which the items at the top of the hierarchy, nearest the browser, take precedence over items lower in the order.

By way of further explanation:

  1. 1. The data, for the most part, is stored in basic form in the database of your installation. Formatting, if any, is present only as HTML tags that may have been specified in the content by the author.

  2. 2. The first significant step on the way to output occurs when the Drupal core extracts and pre-processes the data. No real formatting occurs at this level. Any HTML formatting specified in items stored in the DB is simply passed through for interpretation by the browser.

  3. 3. The next step on the way to output sees the templating engine begin to assemble to core and module output into something close to final form.

  4. 4. The final step prior to output occurs when the theme-specific files process the data. This last stage can have a wide range of impacts, from minimal to very significant. The variance in impact depends on the extent to which the theme's author has provided specific directions for the formatting of various items and whether the author has chosen to override the formatting of the templating engine or of the default style sheets in the Drupal distro—all topics we will cover in depth later in this book.

You have been reading a chapter from
Drupal 5 Themes
Published in: Dec 2007
Publisher: Packt
ISBN-13: 9781847191823
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image