Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flatiron.js / plates - How to work with templates and i18n?

I just started looking at plates, as many people are talking about it.

There are some examples for plates with little html snippets, but not really a full-blown template file. So I am wondering how I can separate especially the layout into a layout.html file and the content distributed into several content.html files?

Also, I'd like to know if there are some strategies for multi-language-sites in flatiron.js/plates?

Thanks!

like image 516
Patrick Avatar asked Mar 19 '12 14:03

Patrick


1 Answers

You can do the seperation pretty easily. You can write a function which binds given string into a layout. Now all you need to do is form the string using plates.bind (this is the content) and pass it to that function which uses plates.bind on the layout.html

Example: https://github.com/flatiron/flatiron/blob/scaffolding/lib/flatiron/plugins/plates.js#L64-66

like image 173
Pavan Kumar Sunkara Avatar answered Sep 16 '22 22:09

Pavan Kumar Sunkara