diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index e4e5ebbc6f..91c15a5de7 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -302,7 +302,13 @@ middleware.renderHeader = function(req, res, callback) { templateValues.template = {name: res.locals.template}; templateValues.template[res.locals.template] = true; - app.render('header', templateValues, callback); + plugins.fireHook('filter:middleware.renderHeader', {templateValues: templateValues, req: req, res: res}, function(err, data) { + if (err) { + return callback(err); + } + + app.render('header', data.templateValues, callback); + }); }); }; @@ -520,4 +526,4 @@ module.exports = function(webserver) { middleware.admin = require('./admin')(webserver); return middleware; -}; \ No newline at end of file +};