Mustache support in Magnolia

Earlier today, I was in meeting where I mentioned Mustache to partners. They looked at me: “yeah, but does it really work?”. I kicked myself in the butt, because all I could say was, “in theory, yes”.

Well, I’d kicked myself enough about this and couldn’t take it anymore.

It’s now more than theory, and is on Git: http://git.magnolia-cms.com/gitweb/?p=forge/mustache-rendering.git
… and Jira, because really, at this stage, it’s just a proof of concept. I was still happy to get that under just a few lines, but I’ll now need help to get it to the next level. Please contribute !

If you’re wondering what Mustache is, it’s just a great templating language that exists on several platforms (javascript, ruby, php, java to name a few), with a proper spec and a battery of tests to validate every implementation.

Mustache: http://mustache.github.io
Mustache.java: https://github.com/spullara/mustache.java

6 thoughts on “Mustache support in Magnolia

    • Cheers Marvin ! I reported the 4 first things that came to mind on Jira. I haven’t really thought about it more than that, I just really needed to get it out of my head and see it work in principle. I’m suspecting that for rendering areas etc, using Handlebars instead might help.

      One of the key things I had in mind was cross-platform templating (e.g rendering something on the server, or even in AdminCentral, and use exactly the same template on the client (retrieve it via REST, render it with mustache.js). That makes more sense in the context of rendering components than pages and areas, or in the context of rendering “content” (as in, content out of a content app). I see no reason to not make both possible, however.

  1. Does handlebars-magnolia-renderer work without Blossom, just for static pages. I mean as complete replacement of Freemarker ?

Leave a Reply to Vasily Cancel reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>