mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	closes #6535
This commit is contained in:
		| @@ -34,6 +34,7 @@ module.exports = function (middleware) { | |||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			var ajaxifyData; | 			var ajaxifyData; | ||||||
|  | 			var templateToRender; | ||||||
| 			async.waterfall([ | 			async.waterfall([ | ||||||
| 				function (next) { | 				function (next) { | ||||||
| 					options.loggedIn = !!req.uid; | 					options.loggedIn = !!req.uid; | ||||||
| @@ -45,6 +46,7 @@ module.exports = function (middleware) { | |||||||
| 					plugins.fireHook('filter:' + template + '.build', { req: req, res: res, templateData: options }, next); | 					plugins.fireHook('filter:' + template + '.build', { req: req, res: res, templateData: options }, next); | ||||||
| 				}, | 				}, | ||||||
| 				function (data, next) { | 				function (data, next) { | ||||||
|  | 					templateToRender = data.templateData.templateToRender || template; | ||||||
| 					plugins.fireHook('filter:middleware.render', { req: req, res: res, templateData: data.templateData }, next); | 					plugins.fireHook('filter:middleware.render', { req: req, res: res, templateData: data.templateData }, next); | ||||||
| 				}, | 				}, | ||||||
| 				function (data, next) { | 				function (data, next) { | ||||||
| @@ -79,7 +81,7 @@ module.exports = function (middleware) { | |||||||
| 							renderHeaderFooter('renderHeader', req, res, options, next); | 							renderHeaderFooter('renderHeader', req, res, options, next); | ||||||
| 						}, | 						}, | ||||||
| 						content: function (next) { | 						content: function (next) { | ||||||
| 							render.call(self, template, options, next); | 							render.call(self, templateToRender, options, next); | ||||||
| 						}, | 						}, | ||||||
| 						footer: function (next) { | 						footer: function (next) { | ||||||
| 							renderHeaderFooter('renderFooter', req, res, options, next); | 							renderHeaderFooter('renderFooter', req, res, options, next); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user