Drupal 7 Development by Example Beginner’s Guide
Formats:
save 15%!
save 37%!
Free Shipping!
| Also available on: |
|
- A hands-on, example-driven guide to programming Drupal websites
- Discover a number of new features for Drupal 7 through practical and interesting examples while building a fully functional recipe sharing website
- Learn about web content management, multi-media integration, and e-commerce in Drupal 7
Book Details
Language : EnglishPaperback : 366 pages [ 235mm x 191mm ]
Release Date : May 2012
ISBN : 1849516804
ISBN 13 : 9781849516808
Author(s) : Kurt Madel
Topics and Technologies : All Books, Beginner's Guides, Drupal, Open Source, Web Development
Table of Contents
PrefaceChapter 1: Getting Set up
Chapter 2: Custom Content Types and an Introduction to Module Development
Chapter 3: HTML5 Integration for Drupal 7 and More Module Development
Chapter 4: Introduction to Drupal 7 Theme Development
Chapter 5: Enhancing the Content Author's User Experience
Chapter 6: Adding Media to our Site
Chapter 7: How Does it Taste – Getting Feedback
Chapter 8: Recipe Lists and More with Views
Chapter 9: Rotating Banners and Project Promotion
Chapter 10: Test Your Code with SimpleTest
Chapter 11: Introduction to the Features Module and Configuration Management
Pop quiz Answers
Index
- Chapter 1: Getting Set up
- Installing an Apache, MySQL, and PHP stack
- Mac OS X AMP stack
- Time for action – downloading the latest version of MAMP
- Windows AMP stack
- Time for action – downloading the latest version of XAMPP
- PHP configuration
- Time for action – modifying php.ini settings
- MySQL configuration
- Time for action – modifying the MySQL my.cnf settings
- Time for action – creating an empty MySQL database
- Installing Git
- Time for action – installing Git for Mac OS X
- Time for action – installing Git for Windows
- Installing Drush
- Time for action – installing Drush for Mac OS X
- Time for action – installing Drush for Windows
- Installing Drupal 7
- Time for action – installing Drupal 7
- Installing the Aptana Studio IDE
- Time for action – installing the Aptana IDE
- Time for action – creating a new Aptana Studio PHP project
- Drupalize Aptana Studio
- Time for action – setting up the Drupal content type associations
- Time for action – installing the Drupal-specific Aptana formatter profile
- Drupal.org from a developer's perspective
- Summary
- Chapter 2: Custom Content Types and an Introduction to Module Development
- Creating custom Recipe content type
- Time for action – creating a custom Recipe content type
- Developing a custom module
- Time for action – developing a custom module
- Quick introduction to Views
- Time for action – installing the Views module
- Time for action – creating a recipe block listing with Views
- Introducing the Devel module
- Time for action – installing the Devel Generate content module
- Time for action – generating content with the devel_generate module
- Summary
- Chapter 3: HTML5 Integration for Drupal 7 and More Module Development
- First things first—changing our DOCTYPE
- Time for action – installing the HTML5 Tools module
- HTML5, RDFa, and Microdata
- Time for action – installing the Microdata module
- Time for action – configuring Microdata for our Recipe content type
- Drupal development and the Drupal community
- Time for action – creating issues in Contrib modules' issue queues
- Time for action – adding Microdata mappings for Recipe number_integer fields
- NutritionInformation module
- Time for action – developing a custom module for a compound NutritionInformation field
- Time for action – updating the Recipe content type to use the NutritionInformation field
- Summary
- Chapter 4: Introduction to Drupal 7 Theme Development
- Creating a sub-theme
- Time for action – installing a base theme
- Time for action – creating a sub-theme and setting it as our default theme
- Time for action – creating a sub-theme and setting as default theme with Drush
- Time for action – configuring our Omega-based sub-theme
- Manage the display for a content type
- Time for action – using the Manage Display page to update the display of our custom Recipe content type
- Drupal 7 Render Arrays
- Time for action – implementing hook_preprocess_node
- An introduction to the Drupal 7 field group module
- Time for action – creating the wrapper with display suite
- Summary
- Chapter 5: Enhancing the Content Author's User Experience
- Developing a custom block for adding content
- Time for action – developing a custom block for adding recipes
- Introduction to the WYSIWYG module
- Time for action – installing and configuring the Wysiwyg module
- A new recipe
- Time for action – deleting all Devel-generated recipe content
- Time for action – adding my Cannellini Cumin Chicken Chili recipe
- Developing a custom contenteditable module
- Time for action – developing an HTML5 contenteditable module
- Summary
- Chapter 6: Adding Media to our Site
- Introduction to the Media module
- Working with dev versions of modules
- Time for action – using Drush to install a dev version of the Media module
- Enhancing the Recipe content type with a Media field
- Time for action – adding a Media field to our Recipe content type
- A new Recipe for our site
- Custom image styles and inline Media for WYSIWYG
- Creating a custom image style
- Time for action – adding a custom image style through the image styles administrative page
- Time for action – creating a programmatic custom image style
- Time for action – configuring Media-based images to use our custom small image style for our Recipe content type
- Inline Media with WYSIWYG
- Time for action – configuring WYSIWYG inline Media for the basic page content type
- Integrating the Colorbox and Media modules
- Time for action – installing the Colorbox module
- Introduction to the Colorbox File module and Drupal sandboxing
- Drupal developer community: Drupal sandbox
- Revisit the sandbox Colorbox File module
- Time for action – checking out the Colobrbox File sandbox project with Git, and testing it with the latest Media module
- Drupal issue queues and enhancing the Colorbox File module
- Time for action – applying and testing the patch for the Colorbox File module
- Summary
- Chapter 7: How Does it Taste – Getting Feedback
- Introduction to the Drupal contact form
- Time for action – enabling and configuring the core contact form
- Adding descriptive help text to our contact form
- Using custom code to add help text to the contact form
- Time for action – adding help text to our site contact form
- Adding contact help text with no code
- Time for action – creating a contact form with help text, with the Webform module
- A more in-depth look at the Webform module
- Time for action – using hook_form_FORM_ID_alter to modify our Webform-based contact form
- Time for action – using hook_form_BASE_FORM_ID_alter to make our Webform emailfield code more generic
- Time for another recipe
- Colorbox File enhancements
- Time for action – enhancing the Colorbox File module with field-based captions
- Rating recipes with Fivestar
- Time for action – installing and configuring the Fivestar module
- Time for action – creating a custom Fivestar widget
- Summary
- Chapter 8: Recipe Lists and More with Views
- Views revisited – advanced configuration
- Random top rated recipe block
- Time for action – building a random top rated recipe block with views
- Taxonomy-based View with tabs
- Time for action – creating a cuisine vocabulary to organize recipes
- Time for action – creating a Recipes by cuisine type Views block
- Time for action – installing and using the Views Field View module for our Recipe by Cuisine Type View
- Tabbed Views display
- Time for action – developing a Views style plugin for Semantic tabs
- Time for another Recipe
- Promoting the Colorbox File module as a full project
- Introduction to the Coder module
- Time for action – installing and using the Coder module
- Commit changes to Colorbox File sandbox
- Time for action – committing Colorbox File module changes to Drupal Git Repository
- Summary
- Chapter 9: Rotating Banners and Project Promotion
- Rotating banner with Views Slideshow
- Time for action – installing the Views Slideshow module
- Custom Drush commands
- Time for action – creating a custom Drush command to install the jQuery Cycle plugin
- Creating a rotating banner with Views Slideshow
- Time for action – creating a banner using the Views Slideshow module
- Enhance the appearance of our rotating banner with a pager and CSS
- Time for action – updating the front banner view to include a slideshow pager
- Time for another recipe
- Promoting a sandbox project to a full project
- Time for action – implementing hook_uninstall for the Colorbox File module
- Time for action – uninstalling and renaming the Colorbox File module
- Time for action – promoting the Media Colorbox module to be a full project on Drupal.org
- Summary
- Chapter 10: Test Your Code with SimpleTest
- What is SimpleTest?
- SimpleTest in Drupal Core
- SimpleTest web interface
- Test files structure for modules
- The SimpleTest class
- Unit Testing with the Drupal SimpleTest module
- Functional or web testing with Drupal SimpleTest
- Time for another recipe
- Writing our own SimpleTests
- Time for action – creating a unit test case for the D7Dev duration formatter
- Time for action – creating a web test case for the D7Dev duration formatter
- Summary
- Chapter 11: Introduction to the Features Module and Configuration Management
- Introduction to the Features module
- Using Features to manage configuration
- Drupal components that can be managed with Features
- Time for action – installing the Features module
- Adding a new Feature
- Time for action – creating a Recipe content type feature
- Managing updates to Feature components
- Time for action – updating our Recipe content type feature
- Features for sharing Drupal components
- Summary
Kurt Madel
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
- 2 submitted: last submission 28 Mar 2013Errata type: Code| Page number: 48 | Errata date: 20-3-2013
Missing step: you must add the gcd($a, $b) function to the module file. It's in the example code for Chapter 2 but not in the book so when you follow the steps you get a fatal error when Drupal calls the d7dev_field_formatter_info() function.
Errata type: Others | Page number: 52 | Errata date: 11-3-2013
The "cookTime" and "prepTime" displayed on the page are "1 and 1/2 hours" and "1/4 hours", respectively. The cookTime and prepTime values entered from page 44 were 30 minutes and 10 minutes, respectively, meaning that the values displayed should actually be "1/2 hours" (cookTime) and "1/6 hours" (prepTime).
Sample chapters
You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.
- Build cutting edge websites with Drupal 7
- Discover important concepts for HTML5 and why it’s time to start building websites with HTML5, if you haven’t already
- Learn important patterns for JavaScript and AJAX in Drupal 7
- Realize interesting ways to integrate multi-media with Drupal 7
- Find out how becoming more involved with the Drupal development community can help you build better websites
- Set up a development environment, and learn to use Git and Drush
- Learn how to do e-commerce with Drupal 7
- Uncover how much fun it can be to build websites with Drupal 7
Drupal is a powerful PHP content management system that allows you to build a wide variety of websites. By combining the power of HTML5, JavaScript, and CSS, you can develop and customize a fully-functional, world-class website. This book also covers some important changes from Drupal 6 to version 7, so even experienced Drupal users will find this straightforward guide useful.
Drupal 7 Development by Example Beginner’s Guide has numerous code examples that will not only introduce new Drupal 7 development concepts, but will give you the skills needed to build a world-class Drupal website. By following the development of a recipe-sharing, e-commerce site, you will quickly and easily get your own Drupal site up and running.
Starting from a solid Drupal 7development environment, this book will show you how to extend Drupal with front- end code using Ajax, jQuery, and server side PHP. In addition to learning how to integrate HTML5, the book will cover responsive web design, and cutting edge CSS3. Using the example of an e-commerce and social networking site, this book will develop your Drupal programming skills so that you will be capable of developing advanced code good enough to be shared with the Drupal community.
As part of Packt’s Beginner’s Guide series, this book will walk the reader through straightforward examples that show the creation of an e-commerce site built on Drupal.
This book is for people who have some experience building websites and who want to learn to do so with Drupal 7. You should have experience with HTML markup, CSS, and jQuery. Experience with previous versions of Drupal would be helpful, but is not necessary.

