Building New Topic Lists

Take a look at the Hot Topics repo:

If I understand what you’re asking correctly, this plugin does a lot of what you’re talking about. It creates a new topic list that you add to the navigation bar in your site settings. Check out the Meta topic here for more on what it does:

Ultimately, you just need to create new filters for the ListController to work with. If you want to redefine the handlebars template for it you can. But in most cases, this isn’t necessary as you can see in this plugin. It simply needed the I18n YAML and it was ready to go.

Here’s an example from the Static Pages plugin.

/my-plugin/assets/javascripts/discourse/my-plugin-route-map.js.es6

export default function(){
  this.route('dl-static-pages', {path: '/page'}, function(){
    this.route('page', {path: '/' }, function(){
      this.route('show', {path: '/:slug/:id'});
    });
  });
};
5 Likes