Skip to content

Node.js based forum software built for the modern web

filter:homepage.get for populating available routes on ACP

psychobunny0fadaf037aba
diff --git a/src/controllers/admin.js b/src/controllers/admin.js
index 62e09eb965..e0912a668c 100644
--- a/src/controllers/admin.js
+++ b/src/controllers/admin.js
@@ -257,7 +257,22 @@ adminController.navigation.get = function(req, res, next) {
};
adminController.homepage.get = function(req, res, next) {
- res.render('admin/general/homepage', {});
+ plugins.fireHook('filter:homepage.get', {routes: [
+ {
+ route: 'categories',
+ name: 'Categories'
+ },
+ {
+ route: 'recent',
+ name: 'Recent'
+ },
+ {
+ route: 'popular',
+ name: 'Popular'
+ }
+ ]}, function(err, data) {
+ res.render('admin/general/homepage', data);
+ });
};
adminController.settings.get = function(req, res, next) {
diff --git a/src/views/admin/general/homepage.tpl b/src/views/admin/general/homepage.tpl
index f784e64ce2..d17593f15a 100644
--- a/src/views/admin/general/homepage.tpl
+++ b/src/views/admin/general/homepage.tpl
@@ -5,9 +5,9 @@
<form>
<label>Home Page Route</label>
<select class="form-control" data-field="homePageRoute">
- <option value="categories">Categories</option>
- <option value="recent">Recent</option>
- <option value="popular">Popular</option>
+ <!-- BEGIN routes -->
+ <option value="{routes.route}">{routes.name}</option>
+ <!-- END routes -->
</select>
</form>
</div>