In order to learn/apply different discourse concepts, I am building a plugin which will display all the Hot Topics. I haven’t decided the criteria for what a hot topic is yet, but these are the issues I am facing.
I’ve also mentioned my thought-process along with the issue, and I would like more of a thought-process based solution instead of the actual solution which would help me think clearly and generally for solving many other problems.
I’ve created a new menu item using api.addNavigationBarItem
.
I’ve also created a custom route called /hot-topics
in the frontend and backend.
Right now, I am displaying a simple h3 heading on the /hot-topics
route.
-
My first task is that once I click the NavItem, the navigation bar should still be visible and
Hot Topics
tab should be highlighted.
I think this will be possible with{{navigation-bar}}
component, but I think I need to return the navItems in the model method of the route object so that it be passed to the template.
I returned a hardcoded array from the model method but with no luck. -
My second task is to fetch the so-called Hot Topics and display them on the
Hot Topics
tab.
for that, I am using{{categories-topic-list}}
component. I have a hard time figuring out how I should pass the data to this component to display the needed topics.
Please do suggest some ideas on how to proceed with this. Also, what would be your thought process while trying to solve this problem?