Categories


Archives


Recent Posts


Categories


Finishing No Frills Magento 2 Layout

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

Updated for Magento 2! No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

After much delay and churn, I’m happy to announce that No Frills Magento 2 Layout is complete. You can grab your copy over on the Pulse Storm store, or read the preview online.

After reading this book you’ll finally understand what, exactly, is going on with Magento’s layout handle XML files. You’ll also understand how Magento 2 bootstraps its javascript and CSS systems, fully prepping you for more advanced front end topics. Your twenty five dollar purchase price also gets you a copy of the original No Frills Magento Layout, so whether you and your team are blazing new trails with Magento 2 or quietly keeping a Magento 1 site in tip top shape you’ll be ready for anything.

Long Time Coming

If I was a better business person, I’d subtly brag about aligning the release of this book with the upcoming Magento Imagine conference, and Magento 2’s maturation and stabilization in the upcoming 2.3 release. The truth is a little messier.

As soon as I’d ported Commerce Bug to Magento 2 I immediately turned my attention to updating No Frills Magento Layout for the new platform. My original plan was to do a traditional 2nd edition of the book — keep the general structure of things, but update the content to reflect changes in Magento 2. That turned out to be a — bad choice. For all the surface level similarities between the two versions of Magento, behind the scenes there’s been massive changes in how things are implemented. Even if I’d been able to update the original text, the resulting book would have been too confusing for its ideal reader.

Once a straight update was off the board, it wasn’t clear what should be on the board. In 2010 a book that covered all the ins and outs of an HTML generating domain specific language was the clear thing to write. In 2016 (and then 2017, for release in 2018), this was less clear cut.

Magento layouts are as confusing as ever, but in-addition to this revamped HTML generating system there’s also several new front end systems in place. Magento (like a lot of PHP frameworks) is caught squarely in the middle of a javascript storm and still doesn’t have a clear story for developers.

On top of all that were the then whispers (now raised to a cacophonous roar) that Magento was working on a completely modern, revamped front end system backed by a GraphQL backend that would have nothing to do with the main Magento application. Why go to the trouble of writing, editing, and releasing a book if the world was going to change in a year.

Fundamentals Win Every Time

In the end I pushed through the self-doubt and came up with a book that, while not perfect, does more good than harm and will (I hope) have a lasting impact on the career and work of any Magento developer who reads it.

The core lesson of No Frills Magento Layout was always

Hey — all that XML isn’t a configuration language, its a domain specific programming language that builds trees of HTML templates. Here’s how it works.

This lesson is still at the core of No Frills Magento 2 Layout. The first seven chapters will guide a developer through creating layouts via PHP, how Magento transforms its layout XML into PHP code, and then how all this comes together to create an entire HTML page. There’s even a remnant of the original rewrite there, when Chapter 7 goes on a deep dive of how Magento 2 actually loads all its different XML files. There’s something here for newbie and old hand alike.

The second section of the book focuses on front end fundamentals. We cover how Magento bootstraps its new, modern-ish, CSS and Javascript environments and finish up with a high level discussion of Magento’s Knockout.js scopes.

The final section of the book are the appendixes. Working with Magento 2 means adopting ten years of Magento and general web development concepts and culture. The appendixes are intended as quick primers for these technical concepts. You won’t learn everything about an appendix topic, but you will learn enough to keep moving forward.

I can’t say with any honesty that Magento 2 is the only front end resource you’ll need, but I do believe it teaches you fundamental concepts that are at the core of any Magento 2 system being deployed today. As exciting as Magento’s bleeding edge, PWA/GraphQL efforts are, the main, real world, Magento experience remains a PHP based MVC/MMVM system with progressively enhanced HTML running the show. If you don’t know how to work with that, you’re going to be in a lot of awkward meetings.

Wrap Up

So that’s my as-honest-as-possible pitch for the book. A huge thanks to my Patrons — if not for them I would have given up on this project a while ago. Like most of what I do No Frills Magento 2 Layout was written and edited without many external resources — if you find problems with the book (either english or technical) get in touch via support and we’ll get things set right.

Copyright © Alan Storm 1975 – 2018 All Rights Reserved

Originally Posted: 10th April 2018