mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
Merge pull request #2706 from acardinale/master
Add hooks "filter:topic.build" and "filter:category.build"
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user