mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	plugin templates now have higher priority than theme templates
This commit is contained in:
		| @@ -73,7 +73,7 @@ function compileTemplates(pluginTemplates) { | |||||||
|  |  | ||||||
| 	utils.walk(baseTemplatesPath, function(err, baseTpls) { | 	utils.walk(baseTemplatesPath, function(err, baseTpls) { | ||||||
| 		utils.walk(themeTemplatesPath, function (err, themeTpls) { | 		utils.walk(themeTemplatesPath, function (err, themeTpls) { | ||||||
| 			var paths = pluginTemplates; | 			var paths = {}; | ||||||
|  |  | ||||||
| 			if (!baseTpls || !themeTpls) { | 			if (!baseTpls || !themeTpls) { | ||||||
| 				winston.warn('[themes] Could not find base template files at: ' + baseTemplatesPath); | 				winston.warn('[themes] Could not find base template files at: ' + baseTemplatesPath); | ||||||
| @@ -90,6 +90,12 @@ function compileTemplates(pluginTemplates) { | |||||||
| 				paths[themeTpls[i]] = path.join(themeTemplatesPath, themeTpls[i]); | 				paths[themeTpls[i]] = path.join(themeTemplatesPath, themeTpls[i]); | ||||||
| 			}); | 			}); | ||||||
|  |  | ||||||
|  | 			for (var tpl in pluginTemplates) { | ||||||
|  | 				if (pluginTemplates.hasOwnProperty(tpl)) { | ||||||
|  | 					paths[tpl] = pluginTemplates[tpl]; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  |  | ||||||
| 			async.each(Object.keys(paths), function(relativePath, next) { | 			async.each(Object.keys(paths), function(relativePath, next) { | ||||||
| 				var file = fs.readFileSync(paths[relativePath]).toString(), | 				var file = fs.readFileSync(paths[relativePath]).toString(), | ||||||
| 					matches = null, | 					matches = null, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user