Dev Question: Multiple Topics - Categories Page
-
I'm trying to develop a newspaper/blog type theme for NodeBB. Its been about a year since I've looked at the code /templates and have what might be a very basic question.
On the 'categories' home page, using Lavendar / Persona themes as an example, I see that the category is displayed and the latest topic.
What if I wanted to make the display like this:
Category:
-- 10 Latest TopicsI see
<!-- BEGIN posts --> .... <!-- END posts -->
However, it appears that there is only one latest post here.
Without modifying the code, is there a way for the theme to specify that it wants an X number of topics. Also, is there a way for the theme to specify that it only wants the topic meta and not the actual full post perhaps?
-
-
@shri No real need to modify core code. You should be able to do everything you want inside the hook
filter:categories.build
The data returned is what you see at
api/categories
You would modify that by adding a topics array to each category. Using a method similar to what
src/controllers/category.js
does to retrieve the topics.Then in the template you can add a
<!-- BEGIN topics --><!-- END topics -->
section for each category.