Open adam-lynch opened 9 years ago
I am also interested in this. Plates exports a method "partial" and "append" which are equivalent and which do sub templates. Still, i'm sometimes confused what would be the best way to nest stuff, because there seem to be several ways, one which seems to not need "partial" and "append" at all, but i'm not sure. :-)
I'm planning of using "plates" in my own templating language which should support data binding on top.
I like the idea of plates but I'm not sure how it would work in a project with a lot of partial templates that have to include other templates. Note: I'd be thinking of using it on its own, not as part of flatiron.
Let's say there's a template which has an element which contains another partial template which includes more, etc. Imagine there are a lot of top-level templates like this. How would someone manage this and the mappings needed? Each top-level template would need a specific permutation of mappings & partial injections applied to it. Or in other words, each partial would need its own mapping but this would be have to be managed somehow.
Also, each template may of course use different names for vars. So if one template includes another, the first mapping needs to converted into the second.
With a DSL (let's say with swig), you kind of get this for free; for example:
a.swig.html
b.swig.html
And then rendering
a.swig.html
with{hello: 'a'}
will give :Are there any example projects out there that would show how this should be done?