Book Review: SilverStripe 2.4 Module Extension, Themes, and Widgets Beginner’s Guide

July 27, 2011

SilverStripe 2.4 Module Extension, Themes, and Widgets Beginner’s Guide, by Philipp Krenn. Packt Publishing, 2011. 344 pages. ISBN: 978-1-849515-00-9. Paperback: US$44.99/UK£27.99; e-book: US$30.59.

This review is based on the print edition plus a download of the supplementary files from the author’s github site.

Two sentences

I would require any junior developer joining QI to work through this book and its examples. I would ask the same of developers working at our client organizations who want to do maintenance or extension work on code that QI has delivered.

Overview

This book covers SilverStripe 2.4 development at a level that is sufficient for someone with broad web development skills to be transformed from a SilverStripe beginner into someone who can conceive and build capable, dynamic websites. It assumes familiarity with PHP, HTML, and CSS. Like SilverStripe: The Complete Guide to CMS Development before it, it will not take you beyond intermediate skills. This is not a criticism; it is the book’s stated purpose. The book uses the creation of a web site for a bar (tavern) as its running example.

Strengths

Philipp Krenn writes in a clear style that is easy to comprehend. He documents and explains SilverStripe in a straightforward cognitive style that starts with a principle, then gives examples, provides hands-on experience, and finally recapitulates the principle and practice in sections called “What just happened?” Pop quizzes and summaries at the ends of chapters further contribute to the repetition that helps to drive learning.

Even better, he uses best practices throughout the book and makes sure to explain those practices and conventions. I liked that the book shows how to find syntax errors in templates using the cryptic information from the compiled template. Nice, too, that it covers coding conventions, not just “Convention over Configuration” — this helps prepare the new SilverStripe developer to eventually contribute to the project. The book is an excellent contribution to the SilverStripe community and will enhance the quality of SilverStripe work being done in the field.

The book is not too verbose & not too terse, but the true beginner will have to read closely. This, too, is not a criticism: as with PHP code, it would be far worse for the book to be prolix for the sake of bulk or page count.

Coverage

The book covers what you would expect. Chapter by chapter, the topics are

  1. Principles & concepts
    • Why SilverStripe? — a justification of using the SilverStripe CMS
    • The file structure
    • SilverStripe’s ecosystem
  2. Customizing the Layout — templates and themes
  3. Getting “Control” of Your System — The controller part of MVC
  4. Storing and Retrieving Information — The model part of MVC
  5. Customizing Your Installation — Environment setup
  6. Adding Some Spice with Widgets and Short Codes
  7. Advancing Further with Inheritance and Modules
  8. Introducing Forms
  9. Taking Forms a Step Further — more advanced aspects of form handling, including template customization and ajax validation
  10. [PDF only] Building an Application — Using ModelAdmin and decorators to build a data-management application
  11. [Printed as chapter 10 in the book] Targeting the Whole World — Globalization (internationalization, localization, translation).

Probing the book’s strengths

I was particularly interested in some topics that come up often in projects but are not well covered in official documentation or other SilverStripe resources. These are

  • SiteConfig extension
  • Working on multiple projects on a laptop and deploying them to production (environment management)
  • Front-end ajax
  • Scaling up with the static publisher

I will be covering these in future postings.

What about SilverStripe 3.0?

If you are reading this, you are probably aware of the current activity in the SilverStripe developer community to produce SilverStripe 3.0 by the end of 2011. As this future version of SilverStripe is going to change the APIs and the UI of the system, should anyone buy a book about 2.4?

The answer has to be yes. There is no way a book of this nature can be in synch with the leading edge of development. The principles that the book teaches are taught well and will carry over to 3.0, albeit with some adjustments.

This is the kind of book — a tutorial about an evolving technical topic — that it really makes sense to get as an e-book.

Annoyances

These annoyances are noticeable but not enough to dissuade anyone from using this book.

Typography

I really dislike the typeface for headings. There is no colophon, but Identifont makes me think it is Impact. It is irritating to read at the sizes used in the book. Worse, it is used for page numbers, which are set at about 12 points and surrounded by square brackets. At that size, the numbers run together and all the vertical numbers look like 1s. The result is that page numbers are well-nigh illegible.

The running text is set in a sans-serif font, possibly Amplitude. I prefer serif fonts for running text, but I suppose that sans-serif works better when a book is also distributed as an e-book.

Chapter mangling

It seems that the publisher pulled a chapter and the installation appendix to hold down printing costs. This is mentioned in the preface (who reads prefaces?), and it is not immediately obvious where to find them. They are in the author’s github repository at https://github.com/xeraa/silverstripe-book

As a result, the chapter numbering has been mangled so that the printed Chapter 10 was meant to be Chapter 11. The original Chapter 10 is downloadable only, but when you open chapter-10.pdf, its headline is “Chapter 11.” The README file seems to say that the sample code in the chapter-11 folder is for the paper Chapter 10, and the chapter-10 folder is for the PDF chapter. This was annoying and I hope I’ve saved owners of the paperback edition some time by listing the correct order above.

—Fred Condo