Drupal Mobile Website Development Book Available

By

This article was published in the print magazine Drupal Watchdog, Volume 1 Issue 2, 2011-08, on pages 42-43, by Tag1 Publishing. The magazine was intended to be distributed at Drupalcon London, 2011-08-22, but was released 2011-12. The article was also published on their website.

The number of people who access the Web using mobile devices — such as smartphones and tablets — is growing rapidly every day, to the extent that it has even exceeded the number who surf the Web using traditional platforms, such as laptops and desktop computers. Consequently, the websites we design and build must be made compatible with these new platforms if we hope to serve the needs of most visitors. For Drupal developers, themers, and website administrators, the first question that may come to mind is: What resources are available for learning how to create mobile-ready websites, requiring the minimum time and complexity for us, while resulting in the maximum device compatibility and aesthetic success for our visitors?

Professional Mobile Web Development with WordPress, Joomla! and Drupal
Figure 1. Professional Mobile Web Development

Given the tremendous interest in Drupal mobile websites, one might imagine that there would already be several books published on the subject. But remarkably, as of this writing (May 2011), there is only one! In April 2011, Wrox published a book written by James Pearce: Professional Mobile Web Development with WordPress, Joomla! and Drupal (ISBN 978-0470889510). In this article, I examine the book from the perspective of a Drupal enthusiast. Because the book features two additional CMSs, one might assume that only a third of the book would be of interest to a Drupal programmer. But more than half the material is not specific to any CMS — and I found this CMS-neutral information to be of even greater value. Spanning 552 pages, the book's material is organized into five parts, of which the second and third are the most substantial in length and information.

The first five chapters — which form the first part of the book, "The World of the Mobile Web" — serve as an overview of the mobile Web itself, website development for mobile devices (as compared to the desktop), mobile technologies and networks, their technical limitations, recent developments in the mobile space, online information resources, and mobile browsers. The chapter that probably would be of most interest to Drupal developers is the fifth one, "The Mobile Toolbox", which covers various mobile development techniques, server-side technologies, and programming tools that are frequently chosen for building mobile-ready websites.

Readers conversant with the mobile world may be tempted to skip the first part of the book, and jump straight to the second, "General Mobile Techniques", which addresses mobile development independent of any particular CMS. The author introduces a wide range of topics relevant to mobile web development: navigation menu depth, breadth, grouping, and placement; typography, pagination, multimedia, and forms; CSS and JavaScript; and the entry points and structures of the desktop and mobile versions of the website, relative to one another. Next, readers begin learning how to perform browser detection and allow a site visitor to switch between mobile and desktop versions of the site. This is the first point in the book where readers encounter any significant amount of source code, most of which is a combination of PHP, XML, CSS, and HTTP user-agent fields in request headers. While not utilized by the majority of programmers (at least, knowingly), patterns can help designers and coders leverage proven techniques, yet also learn technologies with which they are unfamiliar. In Chapters 8 through 10, the author presents several user interface patterns utilized by the three featured CMSs (forms, content lists, image galleries, and comments), and explains how they could be applied to mobile websites. He also covers some critical design considerations — such as CSS media queries — and several HTML/CSS templates and libraries that could be valuable as starting points if one opted to not use a CMS plug-in. Sadly, there do not appear to be any Drupal contrib modules to control CSS media queries, possibly because it would require modifying html.tpl.php, and such settings would likely conflict with the themer's choices in the theme's .info file.

In the lengthiest part of the book, "Major CMS Platforms", the author shows how one could apply the aforesaid techniques to create mobile-ready websites based upon the three most popular CMSs (WordPress, Drupal, and Joomla). Developers who use Drupal exclusively will learn nothing of value from the first and third sections. The Drupal-specific chapters (13 and 14) first cover the basics, and then explore the two major relevant contrib modules: Mobile Plugin and Mobile Tools. The main blemish is that the author presents the Mobile Plugin module as a solution for both Drupal 6 and 7, but as of this writing there is no version of it for Drupal 7, and it is no longer being maintained. Readers could also become frustrated because the API calls in Chapter 14 do not work for Drupal 7 (released months before the book), although no mention is made that the code is intended only for Drupal 6.

The last part of the book, "Enhancing and Launching Your Site", may be of interest to Drupal programmers even though it uses WordPress as a framework, because the author discusses how to use two JavaScript-based frameworks, jQuery Mobile and Sencha Touch. He also explores topics such as testing and debugging (using browser plug-ins, mobile emulators, and online testing services), as well as transcoders, traffic analysis, and mobile search and monetization. The final part of the book contains reference information, including some Drupal resources. Most of the example code shown in the book can be downloaded from the publisher's page.

As with any first edition of a technical work, this one has some flaws: Some of the example code could have been better crafted, e.g., using fieldsets for grouping input fields (instead of divs). Also, there are more than three dozen errata in just the first two thirds of the book. Fortunately, none of them obscure the intended meaning of the narrative, or the value of the example source code. Overall, James Pearce's book is a contribution that should be welcomed by all Drupal mobile programmers — and not just because it's the only one currently available!

Copyright © 2011 Michael J. Ross. All rights reserved.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <address> <area> <blockquote> <br> <cite> <code> <dd> <div> <dl> <dt> <em> <fieldset> <h1> <h2> <h3> <h4> <h5> <h6> <hr> <img> <input> <li> <map> <ol> <p> <pre> <span> <strong> <sup> <u> <ul>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.