From cca365432b3deef2921338c2d1f6c344560ec569 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 14 Sep 2014 19:35:10 -0400 Subject: [PATCH] closes #2084 --- src/middleware/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/middleware/index.js b/src/middleware/index.js index 5ea711b46c..6897e34052 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -64,7 +64,15 @@ function routeCurrentTheme(app, themeId, themesData) { } // Theme's templates path - nconf.set('theme_templates_path', themeObj.templates ? path.join(themesPath, themeObj.id, themeObj.templates) : nconf.get('base_templates_path')); + var themePath = nconf.get('base_templates_path'), + fallback = path.join(themesPath, themeObj.id, 'templates'); + if (themeObj.templates) { + themePath = path.join(themesPath, themeObj.id, themeObj.templates); + } else if (fs.existsSync(fallback)) { + themePath = fallback; + } + + nconf.set('theme_templates_path', themePath); } module.exports = function(app, data) {