2

I've been looking at a few client side JS frameworks like SproutCore and JavaScriptMVC, but was wondering if anyone could recommend a JS framework or template engine that has template inheritance support?

For example, if I have a base template, I want to be able to extend templates using the base template, similar to what Jinja template engine does with the {% extend '...' %} tag

Any ideas?

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157

3 Answers3

1

I'm not 100% sure what you what around tempting, but ExtJS 4.0 has an MVC implementation and the XTemplate class for visual/html templating, it also has the ability to extend all it's components and classes, in fact, that's how views are normally defined (by extending their existing components).

Have a look here: http://www.sencha.com/products/extjs

dougajmcdonald
  • 19,231
  • 12
  • 56
  • 89
  • I think you'll find that while ExtJS is based on the principle of extensible classes/components, the templates themselves arent extensible other than at a class level (where the old template is copied into the new type definition). – Steven de Salas Jan 05 '12 at 12:31
  • Yeah I was a bit unsure what his requirement was on the topic of templates. The templates in ExtJS are really powerful but as you say I don't think they can be extended as such. If Josef could give us some more info though there may be a sensible alternative. – dougajmcdonald Jan 05 '12 at 13:07
0

You might find this post handy for a list of MVC frameworks.

Is there a JavaScript MVC (micro-)framework?

With some additional templating support on: jQuery templates, _.template, Haml-js, eco

As far as I'm aware none of the options out there support this kind of extensible templates, I think its an awesome idea though.

Community
  • 1
  • 1
Steven de Salas
  • 20,944
  • 9
  • 74
  • 82
0

Backbone.js allows you to plug in your own templating engine. By default it uses jquery templates, but if you find one that meets your requirements you can swap it in(e.g. handlebars or moustache). I have been using backbone for a while and I am quite happy with it as a client-side "pseudo-MVC" framework.

Dan
  • 1,003
  • 1
  • 7
  • 16