Free Sample
+ Collection

Drupal 7 Development by Example Beginner’s Guide

Beginner's Guide
Kurt Madel

Websites built using Drupal look state-of-the-art and make the most of HTML5. This beginner’s guide teaches by example and helps you build a first-class site using Drupal 7 from start to finish, covering everything from multimedia to e-commerce.
$29.99
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849516808
Paperback366 pages

About This Book

  • 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

Who This Book Is For

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.

Table of Contents

Chapter 1: Getting Set up
Installing an Apache, MySQL, and PHP stack
Time for action – downloading the latest version of MAMP
Time for action – downloading the latest version of XAMPP
Time for action – modifying php.ini settings
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
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
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
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
Time for action – using Drush to install a dev version of the Media module
Time for action – adding a Media field to our Recipe content type
Custom image styles and inline Media for WYSIWYG
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
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
Time for action – checking out the Colobrbox File sandbox project with Git, and testing it with the latest Media 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
Time for action – adding help text to our site contact form
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
What just happened?
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
Time for action – building a random top rated recipe block with views
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
Time for action – developing a Views style plugin for Semantic tabs
Time for another Recipe
Promoting the Colorbox File module as a full project
Time for action – installing and using the Coder module
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
Time for action – creating a custom Drush command to install the jQuery Cycle plugin
Time for action – creating a banner using the Views Slideshow module
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?
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
Time for action – installing the Features module
Time for action – creating a Recipe content type feature
Time for action – updating our Recipe content type feature
Summary

What You Will Learn

  • 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

In Detail

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.

Authors

Read More