Skip to content

Node.js based forum software built for the modern web

action:navigation.get:*

psychobunny44e8323efaaf
diff --git a/src/controllers/index.js b/src/controllers/index.js
index 7495c9ce0d..fb34c66441 100644
--- a/src/controllers/index.js
+++ b/src/controllers/index.js
@@ -31,15 +31,21 @@ var Controllers = {
Controllers.home = function(req, res, next) {
- var route = meta.config.homePageRoute || 'categories';
- if (route === 'categories') {
- Controllers.categories.list(req, res, next);
- } else if (route === 'recent') {
- Controllers.categories.recent(req, res, next);
- } else if (route === 'popular') {
- Controllers.categories.popular(req, res, next);
+ var route = meta.config.homePageRoute || 'categories',
+ hook = 'action:navigation.get:' + route;
+
+ if (plugins.hasListeners(hook)) {
+ plugins.fireHook(hook, {req: req, res: res, next: next});
} else {
- next();
+ if (route === 'categories') {
+ Controllers.categories.list(req, res, next);
+ } else if (route === 'recent') {
+ Controllers.categories.recent(req, res, next);
+ } else if (route === 'popular') {
+ Controllers.categories.popular(req, res, next);
+ } else {
+ next();
+ }
}
};