Installing an Additional Theme

Theme installation requires that you have the ability to move files from your local machine on to your server. Typically, this is done with an FTP client or through your web hosting control panel. The method you use is up to you. It makes no difference to Drupal which method you choose to employ. Odds are your theme was delivered to you as a single file containing a compressed archive of files. When I downloaded Zen, above, I wound up with the file zen-6.x-1.0-beta2.tar.gz. The .tar.gz format...

FPACKTl

feed-icons float right padding 8px position relative display block height 3 0px float left color FFFFFF font-size 10px line-height 35px left 10px ul.primary li.active a.active background-color 2B5986 border solid 1px 18324B content-region-both table width 530px table tbody tr.odd td.menu-disabled background 2B5986 border-bottom solid 1px 336699

Create a Custom Block

At this stage, the site is coming together and getting close to final form. The open issue on the client's wish list was for button ads. For this one, given the budget, he's getting the low tech solution I'm going to create a new block and code the image placement and URL link directly into the block. Go to the Blocks Manager and choose Add Block. Type a descriptive name for the Block title and then use HTML to specify the image and the URL that it links to. We also need to set the visibility...

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

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...

Making the Transition from Zen to

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....