ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 382 forks source link

Multiple layouts dirs #112

Open meitzner-hannes opened 9 years ago

meitzner-hannes commented 9 years ago

Since Express 4 it is possible to pass views an array of views folder. So Express will iterate trough them if no matching view file is found. That works well if you want to structure your views.

app.set('views', [ path.join(__dirname, 'views'),
                   path.join(__dirname, 'modules/mod1/views'),
                   path.join(__dirname, 'modules/mod2l/views')]);

But that does not work with layouts. Express-handlebars will only search in the one configured layoutsfolder or the default one.

Would be nice if we could also specify multiple layoutsdirs. OR change it inside the router.

ericf commented 9 years ago

Feel free to send a PR for this and I'll happily add it.