Table of Contents
Preface
Chapter 1: The Elements of a Drupal Theme
Chapter 2: Theme Set Up and Configuration
Chapter 3: Working with Theme Engines
Chapter 4: Style Sheets and Themeable Functions
Chapter 5: Intercepts and Overrides
Chapter 6: Modifying an Existing Theme
Chapter 7: Building a New Theme
Chapter 8: Dealing with Forms
Appendix A
Index
- Chapter 1: The Elements of a Drupal Theme
- What is a Theme?
- What is a Templating Engine?
- The Range and Flexibility of Drupal Themes
- What You See on the Screen
- The Big Picture: How Drupal Displays a Page
- The Importance of Themes in Drupal
- Key Concepts
- Build with Blocks
- Intercept and Override
- Key Concepts
- The Contents of the Drupal Distro
- The Theme Files
- The Files of a PHPTemplate Theme
- The Files of a Pure PHP Theme
- Summary
- Chapter 2: Theme Set Up and Configuration
- Finding Additional Themes
- Installing an Additional Theme
- Configuring a Theme
- Theme-Specific Configuration Options
- Global Configuration Settings
- Managing Modules and Blocks
- The Module Manager
- The Blocks Manager
- Adding PHP to Blocks
- Theming in Action: Dressing Up Garland
- Set the Color Scheme
- Change Display Settings
- Upload Logo
- Global Configuration
- 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
- A Look at the Theme Engine Files
- A Look at the Key PHPTemplate File Contained in the Theme
- Two Contrasting Examples
- A Basic PHPTemplate Theme—Gagarin
- A More Complex PHPTemplate Theme—Garland
- Alternative Theme Engines
- PHPTAL
- Smarty
- PHP XTemplate
- Installing Additional Theme engines
- Summary
- Chapter 4: Style Sheets and Themeable Functions
- A Guide to Drupal Style Sheets
- Identifying Themeable Functions
- A Guide to Themeable Functions
- Aggregator Module Functions
- Block Module Functions
- Book Module Functions
- Color Module Functions
- Comment Module Functions
- Drupal Module Functions
- Filter Module Functions
- Form Functions
- Forum Module Functions
- Locale Functions
- Menu Functions
- Node Module Functions
- Pagination Functions
- Poll Module Functions
- Profile Module Functions
- Search Module Functions
- System Module Functions
- Taxonomy Module Functions
- Theme Functions
- Upload Module Functions
- User Module Functions
- Watchdog Module Functions
- Summary
- Chapter 5: Intercepts and Overrides
- Overriding the Default CSS
- CSS Overrides in Action
- Overriding Functions
- Where to Place Overrides
- How to Name Your Overrides
- Overrides in Action: How Garland Works
- Intercepting PHPTemplate Files
- Overriding Themeable Functions in Garland
- Various Approaches to Overrides
- Intercepting and Substituting Files
- Placing Overrides in the Theme's template.php File
- Modifying the PHPTemplate Engine Files
- Placing Overrides in Dedicated Files
- Intercepting Template Files
- Summary
- Overriding the Default CSS
- Chapter 6: Modifying an Existing Theme
- Setting Up the Workspace
- Planning the Modifications
- Cloning a Theme
- First Look at Zen/Tao
- CSS in Zen/Tao
- Themeable Functions in Zen/Tao
- Turning Zen into Tao
- Configuring the Theme
- Set Global and Theme Configuration Options
- Enable Modules
- Set User Access
- Create Dummy Content
- Set Up Menus
- Add New Regions
- Enable and Configure Blocks
- Position Blocks
- Adapting the CSS
- Setting the Page Dimensions
- Formatting the New Regions
- Fonts and Colors
- Formatting the Sidebars and Footer
- Formatting the Menus
- Formatting the Search Box
- Formatting the Comments Form and Output
- Adapting the Themeable Functions
- Modifying template.php
- Creating a New Template File
- Before and After
- Configuring the Theme
- Summary
- Chapter 7: Building a New Theme
- Planning the Build
- Build a New PHPTemplate Theme
- 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
- Building a page.tpl.php File
- Extending Your PHPTemplate Theme
- Working with Template Variables
- Variables Available in block.tpl.php
- Variables Available in box.tpl.php
- Variables Available in comment.tpl.php
- Variables Available in node.tpl.php
- Variables Available in page.tpl.php
- Intercepting and Overriding Variables
- Making New Variables Available
- Dynamic Theming
- Using Multiple Templates
- Dynamically Theming Page Elements
- Creating Dynamic CSS Styling
- Working with Template Variables
- 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: Dealing with Forms
- How Forms Work in Drupal
- Modifying and Overriding Form Functions
- Adding HTML via Function Attributes
- Using form_alter()
- Overriding Form Functions from template.php
- Creating Custom Templates for Forms
- Page Templates
- Block Templates
- Templates for Forms Output
- Common Form Issues
- Modifying Data Labels and Other Text
- Using form_alter()
- Override the Function
- Create a New Template
- Add a Node
- Modifying the Styling of a Form
- Using form_alter()
- Override the Function
- Create a New Template
- Using Images for Buttons
- Modifying Data Labels and Other Text
- The Default Forms
- The User Forms
- The Login Forms
- The User Registration Form
- The Request Password Form
- The Edit User Info 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



