filter:middleware.render

v1.18.x
barisusakli 8 years ago
parent e86708cb0c
commit 97c0b33cf6

@ -34,11 +34,6 @@ module.exports = function (middleware) {
var ajaxifyData; var ajaxifyData;
async.waterfall([ async.waterfall([
function (next) { function (next) {
plugins.fireHook('filter:' + template + '.build', {req: req, res: res, templateData: options}, next);
},
function (data, next) {
options = data.templateData;
options.loggedIn = !!req.uid; options.loggedIn = !!req.uid;
options.relative_path = nconf.get('relative_path'); options.relative_path = nconf.get('relative_path');
options.template = {name: template}; options.template = {name: template};
@ -46,6 +41,14 @@ module.exports = function (middleware) {
options.url = (req.baseUrl + req.path).replace(/^\/api/, ''); options.url = (req.baseUrl + req.path).replace(/^\/api/, '');
options.bodyClass = buildBodyClass(req); options.bodyClass = buildBodyClass(req);
plugins.fireHook('filter:' + template + '.build', {req: req, res: res, templateData: options}, next);
},
function (data, next) {
plugins.fireHook('filter.middleware.render', {req: res, res: res, templateData: data. templateData}, next);
},
function (data, next) {
options = data.templateData;
res.locals.template = template; res.locals.template = template;
options._locals = undefined; options._locals = undefined;

Loading…
Cancel
Save