Drupal 6 Themes: Create new themes for your Drupal 6 site with clean layout and powerful CSS styling

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

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.

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

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

Author(s): Ric Shreves
Publisher: Packt Publishing
Year: 2008

Language: English
Pages: 312

Cover......Page 1
Table of Contents......Page 8
Preface......Page 18
The Importance of Themes in Drupal......Page 24
Theme It in Whole or in Part......Page 25
Build with Blocks......Page 27
Intercept and Override......Page 28
What is a Theme?......Page 29
The Range and Flexibility of Drupal Themes......Page 30
What You See on the Screen......Page 32
The Big Picture: How Drupal Displays a Page......Page 35
The Default Themes of the Drupal Distro......Page 37
The Theme Files......Page 41
The Files of a PHPTemplate Theme......Page 43
The Files of a Pure PHP Theme......Page 45
Summary......Page 46
Finding Additional Themes......Page 48
Installing an Additional Theme......Page 52
Theme-Specific Configuration Options......Page 57
Color Picker......Page 59
Enable/Disable Page Elements......Page 60
Logo Settings......Page 61
Global Configuration Settings......Page 62
The Module Manager......Page 64
The Blocks Manager......Page 66
Configuring Individual Blocks......Page 68
Adding PHP to Blocks......Page 71
Theming in Action: Dressing Up Garland......Page 73
Set Page Elements (Toggle Display Settings)......Page 75
Upload Logo......Page 76
Global Site Information......Page 77
Enable Modules......Page 78
Manage Blocks......Page 79
Add Some Dummy Content and Links......Page 81
Create a Custom Block......Page 82
Set Block Visibility......Page 84
Uninstalling Themes......Page 85
Summary......Page 86
What is PHPTemplate?......Page 88
How Does It Work?......Page 89
The Role of the .info File......Page 92
The Role of the page.tpl.php File......Page 93
A Basic PHPTemplate Theme—Bluemarine......Page 97
A More Complex PHPTemplate Theme—Garland......Page 99
PHPTAL......Page 101
PHP XTemplate......Page 102
Summary......Page 103
Putting Together the Pieces—Templates, Stylesheets, and Functions......Page 104
Default Templates and Variables......Page 105
The Themable Functions......Page 106
Common Theme System Functions......Page 107
Default Templates......Page 108
Themable Functions......Page 110
Default Templates......Page 111
Default Templates......Page 112
Default Templates......Page 114
Default Templates......Page 115
Default Stylesheets......Page 116
Theming the DBLogModule......Page 117
Themable Functions......Page 118
Themable Functions......Page 119
Theming the Forum Module......Page 120
Default Templates......Page 121
Default Stylesheets......Page 122
Default Templates......Page 123
Themable Functions......Page 124
Default Templates......Page 125
Themable Functions......Page 126
Theming the Pagination Functionality......Page 127
Default Templates......Page 128
Default Templates......Page 130
Themable Functions......Page 131
Default Templates......Page 132
Default Stylesheets......Page 133
Default Templates......Page 134
Themable Functions......Page 136
Themable Functions......Page 137
Default Templates......Page 138
Themable Functions......Page 139
Default Templates......Page 140
Themable Functions......Page 142
Summary......Page 143
Overriding the Default CSS......Page 144
CSS Overrides in Action......Page 146
Various Approaches to Overriding Default Styling......Page 148
Substituting Templates......Page 149
Overriding Templates......Page 150
Overriding Themable Functions with Dedicated Template Files......Page 152
Where to Place Themable Function Overrides......Page 154
How to Name Themeable Function Overrides......Page 155
Overrides in Action: A Look at Overrides in Garland......Page 156
Intercepting the Default Template Files......Page 157
Overriding Themable Functions......Page 158
Summary......Page 159
Setting Up the Workspace......Page 160
Planning the Modifications......Page 162
Creating a New Subtheme......Page 163
Making the Transition from Zen to Tao......Page 165
Enabling Modules......Page 166
Creating Dummy Content......Page 167
Setting Up Menus......Page 168
Adding New Regions......Page 170
Enabling and Configuring Blocks......Page 173
Setting the Page Dimensions......Page 175
Setting Fonts and Colors......Page 176
Formatting the Sidebars and Footer......Page 179
Formatting the Vertical Menu......Page 180
Formatting the Search Box and Syndicate Button......Page 181
Adapting the Themable Functions......Page 182
Overriding a Themable Function......Page 183
Modifying a Default Template......Page 184
Before and After......Page 186
Summary......Page 187
Planning the Build......Page 188
Creating a New PHPTemplate Theme......Page 192
Building a .info File......Page 193
Building a page.tpl.php File......Page 195
Insert DocType and Head......Page 197
Insert Body Tags......Page 198
Lay Out the Page Divisions......Page 199
Place the Functional Elements......Page 200
The Final page.tpl.php File......Page 207
The style.css File......Page 210
A Look at Our New Theme......Page 218
Build a New Pure PHP Theme......Page 219
Required Elements......Page 220
Head of Document......Page 221
Site Name......Page 222
Sidebars......Page 223
Tabs......Page 224
Theme Closure......Page 225
Summary......Page 226
Using a Separate Admin Theme......Page 228
Multiple Page or Section Templates......Page 229
Use a Different Template for a Group of Pages......Page 231
Designate a Specific Template for a Specific User......Page 232
Dynamically Styling Modules & Blocks......Page 233
Dynamically Styling Blocks......Page 234
Dynamically Styling the Forum Module......Page 236
Creating Dynamic CSS Styling......Page 237
Changing the Body Class Based on $body_classes......Page 238
Working with Template Variables......Page 240
Intercepting and Overriding Variables......Page 241
Making New Variables Available......Page 242
Summary......Page 243
How Forms Work in Drupal......Page 244
How to Approach Modifying Forms......Page 247
Templates for Blocks Containing Forms......Page 248
Override the Default Template Associated With the Form......Page 250
Using a Theme Function to Control Elements......Page 251
Modifying Forms With Custom Modules......Page 254
Modifying Data Labels and Other Text......Page 257
Modifying the Styling of a Form......Page 258
Using Images for Buttons......Page 259
The User Forms......Page 260
The Login Forms......Page 261
The User Registration Form......Page 262
The User Profile Form......Page 263
The Search Forms......Page 264
The Theme Search Form......Page 266
The Page Search Form......Page 267
The Advanced Search Form......Page 268
The Poll Module Forms......Page 269
Summary......Page 270
A Guide to Drupal Stylesheets......Page 272
admin.css......Page 273
aggregator-rtl.css......Page 274
book-rtl.css......Page 275
color-rtl.css......Page 276
dblog.css......Page 277
defaults-rtl.css......Page 278
help.css......Page 279
maintenance.css......Page 280
openid.css......Page 281
profile.css......Page 282
style.css......Page 283
system.css......Page 284
system-menus.css......Page 285
tracker.css......Page 286
update-rtl.css......Page 287
user-rtl.css......Page 288
Marvin......Page 289
Bluemarine......Page 290
Pushbutton......Page 291
Garland......Page 293
Minnelli......Page 295
Chameleon......Page 296
Content Construction Kit......Page 298
Panels Module......Page 299
The Web Developer Extension......Page 300
Index......Page 302