diff --git a/library.js b/library.js index 9996cb1..ccc03a9 100644 --- a/library.js +++ b/library.js @@ -13,4 +13,56 @@ library.getTeasers = function(data, callback) { callback(null, data); }; -module.exports = library; \ No newline at end of file +library.defineWidgetAreas = function(areas, callback) { + areas = areas.concat([ + { + name: "Categories Sidebar", + template: "categories.tpl", + location: "sidebar" + }, + { + name: "Category Sidebar", + template: "category.tpl", + location: "sidebar" + }, + { + name: "Topic Sidebar", + template: "topic.tpl", + location: "sidebar" + }, + { + name: "Categories Header", + template: "categories.tpl", + location: "header" + }, + { + name: "Category Header", + template: "category.tpl", + location: "header" + }, + { + name: "Topic Header", + template: "topic.tpl", + location: "header" + }, + { + name: "Categories Footer", + template: "categories.tpl", + location: "footer" + }, + { + name: "Category Footer", + template: "category.tpl", + location: "footer" + }, + { + name: "Topic Footer", + template: "topic.tpl", + location: "footer" + } + ]); + + callback(null, areas); +}; + +module.exports = library; diff --git a/plugin.json b/plugin.json index 2413b30..4fa47f9 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,8 @@ "id": "nodebb-theme-persona", "library": "library.js", "hooks": [ - { "hook": "filter:teasers.get", "method": "getTeasers" } + { "hook": "filter:teasers.get", "method": "getTeasers" }, + { "hook": "filter:widgets.getAreas", "method": "defineWidgetAreas" } ], "scripts": [ "lib/persona.js", diff --git a/templates/categories.tpl b/templates/categories.tpl index 51baf42..5038d97 100644 --- a/templates/categories.tpl +++ b/templates/categories.tpl @@ -1,7 +1,14 @@ -
{name}
+ + +{name}
- - -