PacktLib: Drupal 7 Mobile Web Development Beginner’s Guide

Drupal 7 Mobile Web Development


About the Author

About the Reviewers


When is a Phone Not a Phone?

"Dumb" phones

"Smart-er" phones

Smart phones



Mobile-ize me!

What is mobile?

The "One Design" myth

Mobile simulators

Time for action — installing an Android development package


Time for action — installing the Mac OS developer's package


Setting up a Local Development Environment

Drupallo's Pizza Kitchen

Averting disaster

A word about platforms

Time for action — downloading the SCM client for Mac

Cygwin and GIT for Microsoft Windows

Time for action — installing a development environment using Windows and Cygwin

Text editors for Mac OS X and Microsoft Windows

Serving web pages on your computer


Time for action — configuring our first virtual host

Time for action — changing the default configuration for MAMP

WAMP (Windows, Apache, MySQL, and PHP)

Time for action — installing WAMP

Drush and Drush Make

Time for action — installing Drush and Drush Make for Mac OS X

Time for action — installing Drush for Windows

Building a Drupal website with Drush Make

Time for action — building a Drupal install from a make file

The local database

Time for action — creating a database


Selecting the Right Domain for your Mobile Site

Once upon a website...

One ring to rule them all

Time for action — installing Domain Access module

Time for action — configuring Apache

Bootstrapping the domain

Time for action — bootstrapping the Domain Access module

Introduction to the Features module

Time for action — installing and creating your first feature

Time for action — updating the feature with new settings

Deployment—best practices

Time for action — code check-in and deployment

Time for action — check in your features module


Introduction to a Theme

Progressive Enhancement

Drupal 6 versus Drupal 7 theming

Time for action — installing the default mobile theme

The simple life

Media queries

Time for action — personalizing the mobile theme

Redirecting mobile clients

Time for action — writing JavaScript redirection for our theme

Give them what you think they need until they tell you what they want

Behave yourself

Time for action — redirection with a cookie to remember state


A Home with a View

The Context and Display suite modules

Time for action — creating a mobile-friendly home page

Pushing changes from one environment to another

Time for action — updating the Home Page feature

The menu

Time for action — creating the menu content types

Bundling up the changes

Time for action — bundling the changes into a package


The Elephant in the Room: Audio, Video, and Flash Media

Flash and iOS

Incorporating video into your web content

Time for action — embedding media files

Time for action — adding content

Charting and graphs

Time for action — graphing a view


Location, Location, Location


The navigator.geolocation object

Time for action — adding location data to nodes

From address to longitude and latitude

Time for action — geocoding a node's location data

The close2u module

Time for action — downloding and enabling the close2u module

Finishing the page

Time for action — finding the closest franchise the hard way


Services with a Smile

Using Drupal to power your native application

Time for action — creating a REST service

Time for action — testing your new REST service

APIs: The future of the interactive web

Customized services

Time for action — custom REST service formatter

jQuery Mobile

Time for action — using jQM as our base theme

jQuery Mobile JavaScript Events

Time for action — the AJAX login form


Putting it Together

Display Suite

Hooks, styles, and build modes

Time for action — retheming nodes for our jQuery mobile theme

Time for action — adding theming to the rendered node

Beyond core menu items

Time for action — customized menu attributes


Time for action — adding fonts


Tabula Rasa: Nurturing your Site for Tablets

The human touch

The event-driven model

Touch and go

The main event

Time for action — adding a swipe advance to the home page

The changing landscape (or portrait)

"Starting over" or "Everything you know about designing websites is wrong"

Wire framing made easy

Drupal 7 Commerce module

Time for action — the one true theme

Time for action — creating a product

A room with a viewport

Time for action — setting the viewport with JavaScript

Time for action — advanced media queries for tablets


A Home in the Clouds

Problems introduced by modern websites

Amazon Web Services (AWS)

Time for action — setting up AWS and RightScale

Time for action — using an AMI to create a server

Time for action — Jenkins builds our site


Pop quiz Answers