Skip to content

Commit

Permalink
Added res.locals into the prePostsRender filter call
Browse files Browse the repository at this point in the history
closes #2559

 - Added res.locals as a second parameter to the prePostsRender filter
call.
 - This allows accessing the relative url and makes it possible to
react to certain urls.
  • Loading branch information
lmoe committed Apr 22, 2015
1 parent 498a0aa commit 03dcb71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/server/controllers/frontend.js
Expand Up @@ -145,7 +145,7 @@ frontendControllers = {
setReqCtx(req, page.posts);

// Render the page of posts
filters.doFilter('prePostsRender', page.posts).then(function (posts) {
filters.doFilter('prePostsRender', page.posts, res.locals).then(function (posts) {
getActiveThemePaths().then(function (paths) {
var view = paths.hasOwnProperty('home.hbs') ? 'home' : 'index';

Expand Down Expand Up @@ -197,7 +197,7 @@ frontendControllers = {
}

// Render the page of posts
filters.doFilter('prePostsRender', page.posts).then(function (posts) {
filters.doFilter('prePostsRender', page.posts, res.locals).then(function (posts) {
getActiveThemePaths().then(function (paths) {
var view = template.getThemeViewForTag(paths, options.tag),
// Format data for template
Expand Down Expand Up @@ -251,7 +251,7 @@ frontendControllers = {
}

// Render the page of posts
filters.doFilter('prePostsRender', page.posts).then(function (posts) {
filters.doFilter('prePostsRender', page.posts, res.locals).then(function (posts) {
getActiveThemePaths().then(function (paths) {
var view = paths.hasOwnProperty('author.hbs') ? 'author' : 'index',
// Format data for template
Expand Down Expand Up @@ -336,7 +336,7 @@ frontendControllers = {

setReqCtx(req, post);

filters.doFilter('prePostsRender', post).then(function (post) {
filters.doFilter('prePostsRender', post, res.locals).then(function (post) {
getActiveThemePaths().then(function (paths) {
var view = template.getThemeViewForPost(paths, post),
response = formatResponse(post);
Expand Down

0 comments on commit 03dcb71

Please sign in to comment.