8lueberry / express-dot-engine

Node.js engine using the ultra fast doT templating with support for layouts, partials and friendly for front-end web libraries (Angular, Ember, Backbone...)
MIT License
43 stars 10 forks source link

Choose layout master while rendering #20

Open rikkertkoppes opened 8 years ago

rikkertkoppes commented 8 years ago

I'd like to switch layout master based on whether the request was made over xhr or directly. I can also imagine someone switching layout based on other information or model state.

I could not find a direct way to do this. What I came up with for the moment is the following

However, this is not in line with how a model is normally passed on in express template engines.

Any other ideas?