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

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

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