Drupal 7 Themes


Drupal 7 Themes
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
$20.39
save 15%!
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 7 themes
  • No experience of Drupal theming required
  • Discover techniques and tools for creating and modifying themes
  • The first book to guide you through the new elements and themes available in Drupal 7

Book Details

Language : English
Paperback : 320 pages [ 235mm x 191mm ]
Release Date : May 2011
ISBN : 1849512760
ISBN 13 : 9781849512763
Author(s) : Ric Shreves
Topics and Technologies : All Books, CMS and eCommerce, Content Management (CMS), Drupal, Open Source, Web Development

Table of Contents

Preface
Chapter 1: Learning the Basics of Drupal Theming
Chapter 2: Working with the Default Configuration and Display Options
Chapter 3: Understanding PHPTemplate Themes
Chapter 4: Using Intercepts and Overrides
Chapter 5: Customizing an Existing Theme
Chapter 6: Creating a New Theme
Chapter 7: Dynamic Theming
Chapter 8: Dealing with Forms
Chapter 9: Overcoming Common Challenges in Drupal Theming
Chapter 10: Useful Extensions for Themers
Appendix: Identifying Templates, Stylesheets, and Themable Functions
Index
  • Chapter 1: Learning the Basics of Drupal Theming
    • The importance of themes in Drupal
      • One template or many? It's up to you
      • Get creative with configuration
      • Intercept and override
      • Sub-themes are your friends
    • What is a theme?
      • Official Drupal online resources
    • What is a theme engine?
    • The range and flexibility of Drupal themes
    • The output of a Drupal theme
    • The site administrator's view
    • The default Drupal themes
      • Bartik
      • Garland
      • Stark
    • Theme files
    • Summary
    • Chapter 2: Working with the Default Configuration and Display Options
      • Configuring a theme
        • Global Theme Configuration
          • Toggle Display
          • Logo Image Settings
          • Shortcut Icon Settings
        • Theme-Specific Configuration
      • Controlling module and block visibility
        • Introducing the Module Manager
        • Introducing the Blocks Manager
        • Configuring individual blocks
          • Region Settings
          • Visibility Settings
      • Finding additional themes
      • Installing an additional theme
        • Automatic installation
        • Manual installation
      • Uninstalling themes
      • Summary
      • Chapter 3: Understanding PHPTemplate Themes
        • What is PHPTemplate?
        • How does it all work?
        • Key PHPTemplate theme files
          • The role of the .info file
          • The role of the page.tpl.php file
          • Two contrasting examples
            • A simple PHPTemplate theme–Seven
            • A more complex PHPTemplate theme–Bartik
        • Summary
        • Chapter 4: Using Intercepts and Overrides
          • Putting together the pieces
            • Default templates
            • Default stylesheets
            • The themable functions
          • Overriding the default CSS
            • CSS overrides in action
            • Overriding core stylesheets
          • Overriding templates and themable functions
            • Various approaches to overriding the Default Styling
              • Overriding templates
              • Overriding functions
              • Converting themable functions into dedicated templates
            • Overrides in Action: A look at overrides in Bartik
              • Overriding the default template files
              • Overriding themable functions
          • Working with template variables
            • Intercepting and overriding variables
            • Making new variables available
          • Summary
          • Chapter 5: Customizing an Existing Theme
            • Setting up the workspace
            • Planning the modifications
            • Selecting a base theme
            • Creating a new sub-theme
              • Create a copy of the base theme
              • Create the sub-theme in a new directory
              • Delete the files you don't need
              • Update the theme name throughout the sub-theme
              • Create a stylesheet for your sub-theme
              • Update the sub-theme's .info file
            • Customizing the sub-theme
              • Configuring the theme
              • Adapting the CSS
                • Modifying a default template
                • Overriding a themable function
            • Summary
            • Chapter 6: Creating a New Theme
              • Planning the build
              • Creating a new theme through sub-theming
                • Selecting a base theme
                • Creating the sub-theme
                • Configuring the site
                • Styling the new theme
                  • Fusion's theming resources
                  • Customizing the styling
              • Building a new theme without sub-theming
                • Planning the build
                • Creating the necessary elements
                  • Populating the .info file
                  • Customizing the page.tpl.php file
                  • The style.css file
                  • Adding optional elements
                • Packaging your theme
              • Summary
              • Chapter 7: Dynamic Theming
                • Designating a separate Admin theme
                • Using multiple page templates
                  • Creating a unique home page template
                  • Using a different template for a group of pages
                  • Assigning a specific template to a specific page
                  • Designating a specific template for a specific user
                • Dynamically theming page elements
                  • Associating elements with the front page
                  • Styling by region
                  • Dynamically styling blocks
                • Creating dynamic CSS styling
                  • Employing $classes for conditional styling
                  • Adding new variables to $classes
                  • Creating dynamic selectors for nodes
                  • Creating browser-specific stylesheets
                • Summary
                • Chapter 8: Dealing with Forms
                  • The Default Forms
                    • The User Forms
                      • Login Form
                      • User Registration Form
                      • Request Password Form
                      • User Profile Editing Form
                    • Contact Form
                    • Search Forms
                      • Block Search Form
                      • Page Search Form
                      • Advanced Search Form
                      • Search results page
                    • Poll module Forms
                      • Poll Block Form
                      • Poll Page Form
                    • Comment Form
                    • Administration Forms
                  • How Forms work in Drupal
                  • Modifying forms
                    • Working with the CSS styling
                    • Modifying the page or block holding the form
                      • Overriding the templates for pages and nodes containing forms
                      • Overriding the templates for blocks containing forms
                    • Overriding the default form templates
                    • Overriding theme functions to control form elements
                    • Creating dedicated templates for forms
                    • Modifying forms with custom modules
                  • Summary
                  • Chapter 9: Overcoming Common Challenges in Drupal Theming
                    • Maintaining cross-browser compatibility
                    • Creating accessible themes
                      • Validation tools
                      • Drupal theme accessibility basics
                        • Avoiding tables
                        • Creating accessible forms
                        • Not relying on JavaScript
                        • Making sure your text resizes
                        • Ordering elements on the screen logically
                        • Providing hover states and visited states
                        • Providing alternatives to applets and plugins
                        • Supporting a semantic structure
                        • Using system fonts for your menus
                        • Using capitalization appropriately
                        • Using a suitable color scheme
                        • Using jump links
                    • Creating template suggestions for fields
                    • Creating template suggestions for specific nodes
                    • Suggestions for key modules
                      • Styling the Comment module
                      • Styling the Forum module
                      • Styling the Poll module
                      • Styling the Profile module
                      • Styling the Search module
                    • Theming Views
                    • Theming Panels
                    • Theming the maintenance page
                    • Troubleshooting your theme
                      • Basic principles
                      • Troubleshooting common problems
                    • Summary
                    • Chapter 10: Useful Extensions for Themers
                      • Drupal modules
                        • Administration Menu
                        • Chaos Tool Suite
                        • Colorbox
                        • Conditional Stylesheets
                        • Devel
                        • @font-your-face
                        • Frontpage
                        • HTML5 Tools
                        • .mobi Loader
                        • Mobile Theme
                        • Nice Menus
                        • Noggin
                        • Organic Groups
                        • Panels
                        • Semantic Views
                        • Skinr
                        • Style Guide
                        • Sweaver
                        • Taxonomy Theme
                        • ThemeKey
                        • Views
                        • Webform
                      • Third-party software
                        • Drush
                        • Firebug
                        • Web Developer Extension
                        • YSlow
                      • Summary
                      • Appendix: Identifying Templates, Stylesheets, and 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
                          • 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 Dashboard module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the DBLog module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the Field module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the Field UI module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the File 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 Image functionality
                            • 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 Overlay module
                            • 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 Shortcut module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the System module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the Taxonomy module
                            • Default Template
                            • Default stylesheets
                            • Themable functions
                          • Theming the Toolbar module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the Tracker module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the Update module
                            • Default templates
                            • Default stylesheets
                            • Themable functions
                          • Theming the User module
                            • Default templates
                            • Default stylesheets
                            • Themable functions

                        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.

                        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

                        - 3 submitted: last submission 07 Jun 2013

                        Errata type: Typo | Page number: 181 | Errata date: 07 Oct 2011

                        The function name in the code on page 181 should be separated by a space. It should be function user_login_block($form)

                         

                        Errata type: Other | Page number: 110 | Errata date: 23 April 2013

                        The sentence "Note that neither Devel nor Theme Developer are suitable for use in a development environment—you don't want these installed and enabled on a client's public site, as they can present a security risk" should be "Note that both Devel and Theme Developer are suitable for use only in a development environment—you don't want these installed and enabled on a client's site, as they can present a security risk."

                         

                        Errata type: Other | Page number: 116 | Errata date: June 07 2013

                        Step 3 reads "Delete the lines for package, version, and core.". However, removing the line "core = 7.x" causes Drupal to output the following (under the theme description, on the Appearance page): "This version is not compatible with Drupal 7.x and should be replaced." Reinstating the line "core = 7.x" in the jeanb.info file solves this issue.

                         

                        Errata type: Technical | Page number: 123 | Errata date: 21 July 11

                        Missing a space after "function":

                        functionbartik_menu_tree($variables) 

                         

                        Similarly, missing space after "function"

                        functionjeanb_menu_tree($variables) 

                        Errata type: Technical | Page number: 96

                        The filename in the first paragraph and the diagram should be: page--user--1.tpl.php (double dash after user).

                         

                        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 7 Themes +    Apache OFBiz Development: The Beginner's Tutorial =
                        50% Off
                        the second eBook
                        Price for both: $33.00

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

                        What you will learn from this book

                        • Learn about the Drupal 7 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 that responds to the content or the user
                        • Discover tools that make theming easier and more efficient

                        In Detail

                        Drupal is an award winning open source Content Management System (CMS). Based on PHP and 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 your system's front and back-end interfaces.

                        Drupal 7 Themes is an ideal introduction to theming with Drupal 7. If you want to create a striking new look for your Drupal 7 website, this book is for you. This book is a revised, updated and expanded edition of Drupal 6 Themes, rewritten specifically for Drupal 7.

                        This book will show you techniques and tools to help you improve the look and feel of any Drupal 7-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.

                        A practical guide showing you how to create themes for your Drupal 7 site

                        Approach

                        Filled with practical examples, this book helps you to 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; all you need is basic experience of working with Drupal.

                        Although this book aims to make Drupal theming accessible to designers, theming in Drupal 7 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 quickly and easily.

                        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