What Is a Theme Engine

A theme engine is a collection of scripts and files that serve to interpret the programming language used and process the commands contained therein. As data is drawn from the database and from outside sources if any , the theme engine plugs the data into a predetermined format for display. There are several popular theme engines, each of which is designed to interpret different templating languages. Drupal is distributed with the PHPTemplate engine. PHPTemplate is popular for a variety of...

Phptal

PHPTAL is a PHP implementation of the ZPT system. ZPT stands for Zope Page Templates. ZPT is an HTML XML generation tool created for use in the Zope project http www.zope.org . ZPT employs TAL Tag Attribute Language to create dynamic templates. Visit the Zope site to learn more about the origins of the system, and how it all works. TAL is attractive for several reasons. TAL statements come from XML attributes in the TAL namespace that allow you to apply TAL to an XML or plain old HTML document...

PHP XTemplate

PHP XTemplate was once the default theme engine in Drupal but has fallen by the wayside as development of the application slowed. For many users, XTemplate was a popular system. It separates the HTML from the PHP and makes it easy for designers to work with themes. Also, as it is written in PHP and can handle either PHP4 or PHP5, it tends to perform well with Drupal. Unfortunately, at this stage, it seems unlikely to be making a comeback in the near future, and those of you who previously...

Changing the Body Class Based on bodyclasses

One of the most useful dynamic styling tools introduced in Drupal 6 is the implementation of body_classes. This variable is intended specifically as an aid to dynamic CSS styling. It allows for the easy creation of CSS selectors that are responsive to the layout of the page. This technique is typically used to control the styling where there may be one, two or three columns displayed, depending on the page and the content. Prior to Drupal 6, layout was used to detect the page layout, that is, I...

[PACKTl 1

Formatting the Comments Form and Output We enabled the comments functionality earlier, let's now set the look and feel. The comments in the default Zen theme are shaded a light blue, consistent with the Zen color scheme. For Tao, we want to make things a little more conservative, a little more somber, so we will change that to a light gray and also apply our font selections. Make the following changes to the selectors, below margin 0 0 10px 0 padding 10px background f1f1f1 .comment h3.title,...

Creating a New Subtheme

Install the Zen theme if you have not done so before now once that is done we're ready to create a new subtheme. Installing a new theme is covered in Chapter 2. J First, make a copy of the directory named STARTERKIT and place the copied files into the directory sites all themes. Rename the directory tao. Note that in Drupal 5.x, subthemes were kept in the same directory as T .rlsT the parent theme, but for Drupal 6.x this is no longer the case. Subthemes I should now be placed in their own...

Overriding Templates and Themable Functions

As discussed in Chapter 3, the templates and themable functions in Drupal control the HTML formatting for the final display of the contents. While CSS gives you one level of control over look and feel, to make significant changes to the functionality or the page layout you will need to work with the templates or the functions. The default template and themable functions are located in a variety of places inside the distro see Chapter 4 for a listing . If your site is using a theme engine other...

The Theme Files

The themes and their respective files are kept in the directory named themes on your server. The default distro also comes bundled with the PHPTemplate engine. The PHPTemplate files are located in a sub directory inside the themes directory on your server. _ Note that although the default themes are located in the themes I directory, if you create or install new themes, they should be placed in I the sites all themes directory. I To view the theme and theme engine files in your Drupal...

Pushbutton

- .form-item label .item-list .title - td home a hover img .primary-links, .primary-links a link, .primary-links a visited .primary-links a hover - primary-menu .primary-links h1, primary-menu .primary-links h2, primary-menu .primary-links h3 secondary-menu .secondary-links, .secondary-links a link, .secondary-links a visited .secondary-links a hover secondary-menu .secondary-links - subnavlist li, ul.primary-links li, subnavlist li.first, ul.links li.first .tabs ul.primary .tabs ul.primary li...

[PACKTl Azv

modifications, planning 145, 146 new sub-theme, creating 146-148 workspace, setting up 143-145 functions 102 theme_filter_admin_overview, themable functions 102 theme_filter_tips, themable functions 102 theme_filter_tips_more_info, themable functions 102 themable functions 101 Firebug Firefox extension 283 web developer extension 283 flexibility, Drupal theme 13, 15 form, modifying block templates 231, 232 CSS styling, working with 231 custom modules used 237, 238, 240 custom templates,...

Making the Transition from Zen to Tao

The process of transforming an existing theme into something new consists of a set of tasks that can categorized into three groups 3. Adapting the Templates amp Themable Functions As stated previously, the goal of this redesign is to create a blog theme with solid usability and a clean look and feel. The resulting site will need to support forums and comments and will need advertising space. Let's start by enabling the functionality we need and then we can drop in some sample contents....