Feature time: resources and configuration by file

Published on April 9, 2015 by Mikael Geljic

Next to the templating initiative, we, at the product department, are working hard on two key initiatives for Magnolia 5.4: Configuration by file and harmonization of Resources.

As those who attended Amplify Munich may remember, configuration by file offers developers a practical alternative to JCR-based config. The latter is usually lengthilycrafted in the Configuration app, or through verbose raw JCR exports, affectionately known as bootstrap files.

Config by file, on the other hand, holds several concrete promises:

  • A lean, readable format: we chose YAML for that
  • Ease of editing: a good ol’ text editor is enough really
  • Having config files right next to your template scripts, all in one place
  • File observation, catering to instant changes
  • Easier collaboration for dev teams: files are easier to diff, no import/export over and over again
  • Greater validation capabilities


The unfair comparison: bootstrap file vs. YAML file for a simple form field


While this comparison is a bit unfair and cosmetic, it actually gives module developers a better chance to keep their code and config in sync.
Under the hood, config by file builds on a sensible refactoring of the configuration APIs and registries. In fact, it is well tempting to call it “the new configuration”—it becomes a grown up Magnolia module of its own after all. ;)

Alongside configuration, we are unifying the loading cascade for web resources, template scripts—and now configuration files. We want resources to be accessed identically, whichever origin the developer chooses to serve them from. And switching should be seamless too, thus supporting overrides or hot fixes, as illustrated below.

The unified resource-loading cascade


Besides relieving some confusion (admittedly, it doesn’t take a long search in our forums to see that), we believe this has multiple benefits. We are enabling more developers to get onboard with Magnolia, to understand how it works, and to work fluently on a variety of deployment scenarios: from the remote live instance down to the IDE, or through a local light-weight portable instance.

Several months ago, we said Magnolia 5.4 was going to be a release for developers. With the new configuration and unified resource loading, we’re starting to deliver on our promise, so we hope you like what you just read. We most certainly look forward to giving you something hands-on to play with—to let the fun begin!



Marvin Kerkhoff on 9 April, 2015: Nice one. Now Magnolia will be much better and faster to develop. Hope we can see some more examples from a Configuration. How do you handle all the hirachies in the dialog configurations?

Mikael Geljic on 13 April, 2015Hi Marvin, the documentation team is working on new material for 5.4, where you will find sample YAML definitions for templates and dialogs. You can get an early bird impression there: https://documentation.magnolia-cms.com/display/DOCS54/Hello+Magnolia#HelloMagnolia-Createadialogdefinition ;)

Christoph Meier on 9 July, 2015Now hello world moved the space to https://documentation.magnolia-cms.com/display/DOCS/Hello+Magnolia :-)


{{item.userId}}   {{item.timestamp | timestampToDate}}

About the author Mikael Geljic

Mikaël is a UI developer specialized in rich web applications and usability. At Magnolia, he mainly takes care of UI components, user interaction and theming. Prior to Magnolia, he worked on a variety of Web projects for software editors, services companies or web agencies since 2005.

See all posts on Mikael Geljic