mustache / spec

The Mustache spec.
MIT License
364 stars 71 forks source link

Logic-less logic #77

Closed frnco closed 3 years ago

frnco commented 10 years ago

I'm creating tables (Listings of items) for an Admin, and I'm loving Mustache, especially because I want to keep the template structure simple, but the table needs to change according to the area it's in, and I don't wanna create tons of templates with repeated code or split things like my containers etc. in two templates so I can include one before and another after, so...

My ideal solution would be to either:

Any ideas how I should go about any of them?.

jazzdan commented 10 years ago

You might want to look into using one of the implementations that supports template inheritance as outlined in #75 . Then in your parent template you can pass in shared partials. I would have to see a concrete example to know if this would definitely solve your problem though. :)

jgonggrijp commented 3 years ago

Lambda sections would probably also work for this purpose.