Drupal 6 Themes


Drupal 6 Themes
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
$15.59
save 35%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
$39.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Reviews
Support
Sample Chapters
  • Learn to create new Drupal 6 themes
  • No experience of Drupal theming required
  • Techniques and tools for creating and modifying themes
  • A complete guide to the system's themable elements

Book Details

Language : English
Paperback : 312 pages [ 235mm x 191mm ]
Release Date : September 2008
ISBN : 1847195660
ISBN 13 : 9781847195661
Author(s) : Ric Shreves
Topics and Technologies : All Books, CMS and eCommerce, Content Management (CMS), Drupal, Open Source


Table of Contents

Preface
Chapter 1: The Elements of a Drupal Theme
Chapter 2: Theme Setup and Configuration
Chapter 3: Working with Theme Engines
Chapter 4: Identifying Templates, Stylesheets, and Themable Functions
Chapter 5: Intercepts and Overrides
Chapter 6: Modifying an Existing Theme
Chapter 7: Building a New Theme
Chapter 8: Dynamic Theming
Chapter 9: Dealing with Forms
Appendix A: Drupal CSS Map
Appendix B: The Themers' Toolkit
Index
  • Chapter 1: The Elements of a Drupal Theme
    • The Importance of Themes in Drupal
      • Theme It in Whole or in Part
      • Build with Blocks
      • Intercept and Override
    • What Is a Theme?
    • What Is a Theme Engine?
    • The Range and Flexibility of Drupal Themes
    • What You See on the Screen
    • The Big Picture: How Drupal Displays a Page
    • The Default Themes of the Drupal Distro
    • The Theme Files
      • The Files of a PHPTemplate Theme
      • The Files of a Pure PHP Theme
    • Summary
  • Chapter 2: Theme Setup and Configuration
    • Finding Additional Themes
    • Installing an Additional Theme
    • Configuring a Theme
      • Theme-Specific Configuration Options
        • Color Picker
        • Enable/Disable Page Elements
        • Logo Settings
        • Shortcut Icon Settings
      • Global Configuration Settings
    • Managing Modules and Blocks
      • The Module Manager
      • The Blocks Manager
        • Configuring Individual Blocks
      • Adding PHP to Blocks
    • Theming in Action: Dressing Up Garland
      • Set the Color Scheme
      • Set Page Elements (Toggle Display Settings)
      • Upload Logo
      • Global Site Information
      • Enable Modules
      • Manage Blocks
      • Add Some Dummy Content and Links
      • Set Access Levels
      • Create a Custom Block
      • Set Block Visibility
    • Uninstalling Themes
    • Summary
  • Chapter 3: Working with Theme Engines
    • What is PHPTemplate?
    • How Does It Work?
    • Getting Started with PHPTemplate
      • The Role of the .info File
      • The Role of the page.tpl.php File
      • Two Contrasting Examples
        • A Basic PHPTemplate Theme—Bluemarine
        • A More Complex PHPTemplate Theme—Garland
    • Alternative Theme Engines
      • PHPTAL
      • Smarty
      • PHP XTemplate
    • Installing Additional Theme Engines
    • Summary
  • Chapter 4: Identifying Templates, Stylesheets, and Themable Functions
    • Putting Together the Pieces—Templates, Stylesheets, and Functions
      • Default Templates and Variables
      • Default Stylesheets
      • The Themable Functions
    • A Guide to Theming Elements
      • Common Theme System Functions
      • Theming the Aggregator Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Block Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Book Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Color Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Comment Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the DBLog Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Filter Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Form Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Forum Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Help Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Locale Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Menu Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Node Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the OpenID Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Pagination Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Poll Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Profile Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Search Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Syslog Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the System Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Taxonomy Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Tracker Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Trigger Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Update Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the Upload Module
        • Default Templates
        • Default Stylesheets
        • Themable Functions
      • Theming the User Functionality
        • Default Templates
        • Default Stylesheets
        • Themable Functions
    • Summary
  • Chapter 5: Intercepts and Overrides
    • Overriding the Default CSS
      • CSS Overrides in Action
    • Overriding Templates and Themeable Functions
      • Various Approaches to Overriding Default Styling
        • Substituting Templates
        • Overriding Templates
        • Placing Function Overrides in the template.php File
        • Overriding Themable Functions with Dedicated Template Files
      • Where to Place Themable Function Overrides
      • How to Name Themeable Function Overrides
      • Overrides in Action: A Look at Overrides in Garland
        • Intercepting the Default Template Files
        • Overriding Themable Functions
    • Summary
  • Chapter 6: Modifying an Existing Theme
    • Setting Up the Workspace
    • Planning the Modifications
    • Creating a New Subtheme
    • Making the Transition from Zen to Tao
      • Configuring the Theme
        • Enabling Modules
        • Setting Global and Theme Configuration Options
        • Setting User Access
        • Creating Dummy Content
        • Setting Up Menus
        • Adding New Regions
        • Enabling and Configuring Blocks
      • Adapting the CSS
        • Setting the Page Dimensions
        • Formatting the New Regions
        • Setting Fonts and Colors
        • Formatting the Sidebars and Footer
        • Formatting the Menus
        • Creating the Horizontal Menu
        • Formatting the Vertical Menu
        • Formatting the Search Box and Syndicate Button
        • Formatting the Comments Form and Output
      • Adapting the Themable Functions
        • Overriding a Themable Function
        • Modifying a Default Template
        • Before and After
    • Summary
  • Chapter 7: Building a New Theme
    • Planning the Build
    • Creating a New PHPTemplate Theme
      • Building a .info File
      • Building a page.tpl.php File
        • Insert DocType and Head
        • Insert Body Tags
        • Lay Out the Page Divisions
        • Place the Functional Elements
        • The Final page.tpl.php File
      • The style.css File
      • A Look at Our New Theme
    • Build a New Pure PHP Theme
      • Required Elements
      • HTML Headers
      • Head of Document
      • Implementing the Features
        • Favicon
        • Logo
        • Site Name
        • Site Slogan
      • Primary and Secondary Links
      • Sidebars
        • Sidebar Left
        • Sidebar Right
      • Main Content Area
        • Title and Breadcrumb Trail
        • Tabs
        • Help
        • Messages
        • Content Region
      • Footer
      • Theme Closure
      • Overriding Functions
    • Summary
  • Chapter 8: Dynamic Theming
    • Using Multiple Templates
      • Using a Separate Admin Theme
      • Multiple Page or Section Templates
        • Create a Unique Homepage Template
        • Use a Different Template for a Group of Pages
        • Assign a Specific Template to a Specific Page
        • Designate a Specific Template for a Specific User
    • Dynamically Theming Page Elements
      • Associating Elements with the Front Page
      • Dynamically Styling Modules and Blocks
        • Dynamically Styling Blocks
        • Dynamically Styling the Comment Module
        • Dynamically Styling the Forum Module
        • Dynamically Styling the Polls Module
      • Dynamically Styling Nodes
    • Creating Dynamic CSS Styling
      • Using Dynamic Selectors for Nodes
      • Changing the Body Class Based on $body_classes
    • Working with Template Variables
      • Intercepting and Overriding Variables
      • Making New Variables Available
    • Summary
  • Chapter 9: Dealing with Forms
    • How Forms Work in Drupal
    • How to Approach Modifying Forms
      • Working with the CSS Styling
      • Modifying the Page or Block Holding the Form
        • Templates for Pages Containing Forms
        • Templates for Blocks Containing Forms
      • Override the Default Template Associated with the Form
      • Using a Theme Function to Control Elements
      • Modifying Forms with Custom Modules
    • Solutions to Common Form Issues
      • Modifying Data Labels and Other Text
        • Using form_alter()
        • Using a Function
        • Using a Template
      • Modifying the Styling of a Form
        • Using form_alter()
        • Using a Function
        • Using a Template
      • Using Images for Buttons
    • The Default Forms
      • The User Forms
      • The Login Forms
        • The User Registration Form
        • The Request Password Form
        • The User Profile Form
      • The Default Contact Form
      • The Search Forms
        • The Theme Search Form
        • The Block Search Form
        • The Page Search Form
        • The Advanced Search Form
        • The Search Results Page
      • The Poll Module Forms
        • The Poll Block Form
      • The Poll Page Form
    • Summary
  • Appendix A: Drupal CSS Map
    • A Guide to Drupal Stylesheets
      • admin.css
      • admin-rtl.css
      • aggregator.css
      • aggregator-rtl.css
      • block.css
      • book.css
      • book-rtl.css
      • color.css
      • color-rtl.css
      • comment.css
      • comment-rtl.css
      • dblog.css
      • dblog-rtl.css
      • defaults.css
      • defaults-rtl.css
      • forum.css
      • forum-rtl.css
      • help.css
      • help-rtl.css
      • locale.css
      • maintenance.css
      • node.css
      • node-rtl.css
      • openid.css
      • poll.css
      • poll-rtl.css
      • profile.css
      • search.css
      • search-rtl.css
      • style.css
      • system.css
      • system-rtl.css
      • system-menus.css
      • system-menus-rtl.css
      • taxonomy.css
      • tracker.css
      • update.css
      • update-rtl.css
      • user.css
      • user-rtl.css
    • The Stylesheets of the Default Themes
      • Marvin
      • Bluemarine
      • Pushbutton
      • Garland
      • Minnelli
      • Chameleon
  • Appendix B: The Themers' Toolkit
    • Drupal Modules
      • Content Construction Kit
      • Devel Module
      • Panels Module
      • Views Module
    • Firefox Extensions
      • Firebug Firefox Extension
      • The Web Developer Extension

Ric Shreves

Ric Shreves is a web applications consultant and tech author. He’s been building websites since the mid-90s and writing about tech for almost as long. Ric specializes in open source content management systems and has written texts on each of the big three: WordPress, Joomla! and Drupal. Ric is the founding partner of water&stone, a digital agency that focuses on new media and online marketing. He works with clients on digital marketing strategy and supervises the SEO implementation team. Ric lives in Bali and divides his time between the island and Singapore.

Code Downloads

Download the code and support files for this book.


Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 12 submitted: last submission 05 Apr 2013

Errata type: Typo | Page number: 0 |

In the section 'About the Author', his dedication to his wife reads as follows: "who's CSS skills are exceeded... It should be "whose CSS skills are exceeded..."

 

Errata type: Typo | Page number: 11 |

This independence also extends to the presentation layer of these discreet items of code. should be: This independence also extends to the presentation layer of these discrete items of code.

 

Errata type: Typo | Page number: 56 |

Section entitled "Theming In Action: Dressing Up Garland" First sentence: customize is misspelled as "costomize."

 

Errata type: typo | Page number: 66 |

In the illustration the Block body field contains: >img src="sites/default/files/button-ad-1.gif" border="0" /<

 

Errata type: typo | Page number: 79 |

In the order on which they appear are the following regions: header, left sidebar content, right sidebar, and footer regions. Between sidebar and content a missing comma

 

Errata type: Typo | Page number: 82 |

below the illustration: an alternative .css files It should be: file.

 

Errata type: Code | Page number: 134 |

The devel module corrupts parts of the Administer section as a result of which some menus cannot be opened and part of the instructions cannot be carried out. With the developer module installed, the Menu settings can not be opened as suggested on page 150 in the paragraph Creating Dummy Content. Solution: uncheck the Devel module's Theme developer.

 

Errata type: Typo | Page number: 150 |

The fourth bullet point from the last: it should read fixed-width.

 

Errata type: Code | Page number: 150 |

In the paragraph Creating Dummy Content the line Go to Administer | Create content | Create Blog entry should be: go to Create content | Create Blog entry (without Administer).

 

Errata type: Typo | Page number: 151 |

The line Access the Forums option under Content management should be: Access the Forums option under Administer/Content management.

 

Errata type: typo | Page number: 176 |

To set regions, use the following notation: region[..] = .. should be: regions[..] = ..

 

Errata type: Code | Page number: 237 |

The line in the code example at the top of the page: $form['username']['#description'] = t('Enter your username'); should be: $form['name']['#description'] = t('Enter your username');

 

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Drupal 6 Themes +    Learning Vaadin =
50% Off
the second eBook
Price for both: £23.64

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Learn about the Drupal 6 Theming Architecture
  • Find and install new themes
  • Get the most from Drupal's theme configuration system
  • Create a new theme from scratch
  • Master PHPTemplate
  • Modify the default templates and styles
  • Override the default templates with your own
  • Create dynamic styling which responds to the content or the user
  • Discover tools that make theming easier and more efficient


Chapter 1: The Elements of a Drupal Theme
– In this chapter we examine how the theme system in Drupal works and examine the different approaches to working with Drupal themes.

Chapter 2: Theme set Up & Configuration – Here we look at all the various theming options that are available in the default Drupal system. By way of example, we take a default theme and customize it using only the options provided by the system.

Chapter 3: Working With Theme Engines – You will learn how the PHPTemplate theme engine works and how you can use this powerful tool,

Chapter 4: Identifying Templates, Style Sheets and Themable Functions – This chapter identifies all the themable elements in the Drupal system and tells you where to find the elements together with an explanation of their functions.

Chapter 5: Intercepts & Overrides – You will learn how to employ intercepts and overrides to modify the default styling in your Drupal theme.

Chapter 6: Modifying an Existing Theme – Here we look at how to implement extensive modifications to a default Drupal theme. This is a hands-on example of the techniques covered in previous chapters.

Chapter 7: Building a New Theme – In this chapter we examine how you can build from scratch a new theme employing the PHPTemplate theme engine.

Chapter 8: Dynamic Theming – You will learn how the Drupal system enables you to vary the styling between sections, pages or users.

Chapter 9: Dealing with Forms – This chapter covers the styling of forms in Drupal, one of the more complex areas in the system.

Appendix A: A Guide to Drupal Style Sheets – An inventory of the contents of all the style sheets in the Drupal system.

Appendix B: The Themers' Toolkit – A listing of tools and extensions that make your work with themes easier and more efficient.

In Detail

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.

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.

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

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.

This book is the ideal introduction to theming in Drupal 6

Approach

This book helps you understand the logic behind the theming system employed in Drupal, and how to make it work for you. You will learn key concepts and work through examples with careful, step-by-step instructions.

Who this book is for

The main requirements to make use of this book are knowledge of HTML, CSS, and a touch of creativity - you don't need to know anything about theming in Drupal, although you should be familiar with the basic operation of the Drupal system.

Although this book aims to make Drupal theming accessible to designers, theming in Drupal 6 involves writing some PHP code, and a basic knowledge of PHP will be helpful.

Regardless of your technical skills, this book will teach you to design themes for your Drupal websites in the easiest way.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software