diff --git a/src/controllers/categories.js b/src/controllers/categories.js index 187653268d..d5cfda79c8 100644 --- a/src/controllers/categories.js +++ b/src/controllers/categories.js @@ -333,7 +333,12 @@ categoriesController.get = function(req, res, next) { res.locals.linkTags.push(rel); }); - res.render('category', data); + plugins.fireHook('filter:category.build', {req: req, res: res, templateData: data}, function(err, data) { + if (err) { + return next(err); + } + res.render('category', data.templateData); + }); }); }; diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 498a3d81db..1d756b4189 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -266,7 +266,13 @@ topicsController.get = function(req, res, next) { }); topics.increaseViewCount(tid); - res.render('topic', data); + + plugins.fireHook('filter:topic.build', {req: req, res: res, templateData: data}, function(err, data) { + if (err) { + return next(err); + } + res.render('topic', data.templateData); + }); }); };