# Building New Topic Lists

**URL:** https://meta.discourse.org/t/building-new-topic-lists/72772
**Category:** Development
**Created:** [October 25, 2017, 5:07pm UTC](https://meta.discourse.org/t/building-new-topic-lists/72772 "2017-10-25T17:07:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [October 25, 2017, 5:07pm UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/1 "2017-10-25T17:07:31Z")

</div>

Hello,

For the past few weeks I have been working on a plugin that defines new topic lists (there is going to be a new topic list for each user which is going to contain only user’s favorite categories). I am developing this new feature as a plugin and now I got to the part where I have to hook into the client-side. There are a few issues here.

1. I noticed that right now, the current topic lists are “hard-coded” in the sense that there are a few filters that can be applied to categories and tags. This is a issue, because for example to fetch more topics, the client generates some links following a few rules.

2. Adding new routes in Ember JS is not possible from a plugin, because Ember JS does not allow adding more rules at “run-time”.

3. There is also no list support for multiple categories or tags, but I think this would be nice (similar to multi-reddits on Reddit). Somehow, this is basically what I am trying to do, but more limited. However, I would like to implement my plugin with this possibility in mind.

4. Hooking into the navigation bar is a huge pain.

To be honest I am not really sure what you could do to help me, but if you have comments about this, please post. I will greatly appreciate this.

Best wishes,  
Bianca

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [October 25, 2017, 5:19pm UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/2 "2017-10-25T17:19:37Z")

</div>

Hi Bianca, sorry not much response on your issues atm, but could you elaborate on (4) please ? I’m currently working on the plugin api for the new `select-box-kit` and always interested to know what issues you had while using plugin api so I can avoid falling in the same traps.

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [October 25, 2017, 8:42pm UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/3 "2017-10-25T20:42:08Z")

</div>

> [@nbianca](#):
>
> Hooking into the navigation bar is a huge pain.

Sorry, when I said navigation bar I should have been more clear. It is the category / tags dropdown and the nav pills used for filters. What I want to do is add more categories to the list and eventually more nav pills. The problem here is that I want to add my “favorite category” to the dropdown and it is not an actual category.

So… the navigation bar consists of a “bread-crumbs” component which is the category drop down and a “navigation-bar” component which is the bar with “latest”, “new”, etc. How the category drop down is working right now is like:

1. you can only choose from a list of categories and a “fake” category “all categories”.
2. if selected category is `undefined` than it must be `all categories` selected, but in my case, it might be `favorites categories`

Hooking into this navigation bar actually requires a few hooks in a few places and seems to be a very ugly solution and error prone. Also, these hooks do not exist and if I add them, I doubt anyone will ever want to use them as they seem rather specific to my needs.

Anyway, what I am trying to say is that I think that some things might have a more simple implementation and I am wondering what were the design decisions behind the current design.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [October 25, 2017, 8:46pm UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/4 "2017-10-25T20:46:04Z")

</div>

OK that’s even more interesting, those dropdowns are not using the new select-box-kit YET, I don’t know about the design decisions leading to this (it’s also probably very old code), but let’s focus on present/future.

Can I see your code somewhere? It might help me understand your needs more easily.

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [October 25, 2017, 9:51pm UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/5 "2017-10-25T21:51:11Z")

</div>

Take a look at the Hot Topics repo:

[https://github.com/danskdynamit/discourse-hot-topics](https://github.com/danskdynamit/discourse-hot-topics)

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:

> [@Discourse Hot Topics](https://meta.discourse.org/t/discourse-hot-topics/48215):
>
> information_source Discourse now features a /hot topic list in core that can be added to your top menu Repository: [GitHub - danskdynamit/discourse-hot-topics](https://github.com/danskdynamit/discourse-hot-topics) This plugin creates a “Hot” sorting criteria and builds a custom topic list based on the result of the following formula: likes / ((hours since creation + 2) ^ gravity) Things to note: The default gravity multiplier is 1.5 but you can adjust this in the settings for the plugin. You can add “hot” to the list of menu items to make i…

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.

> [@nbianca](#):
>
> Adding new routes in Ember JS is not possible from a plugin, because Ember JS does not allow adding more rules at “run-time”.

Here’s an example from the [Static Pages plugin](https://meta.discourse.org/t/static-pages-plugin-dl-static-pages/69698).

```javascript
/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'});
    });
  });
};

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 25, 2017, 11:08pm UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/6 "2017-10-25T23:08:26Z")

</div>

> [@nbianca](#):
>
> have been working on a plugin that defines new topic lists (there is going to be a new topic list for each user which is going to contain only user’s favorite categories)

Can you elaborate on the use case here? What is this for, what user need does it address? Can you provide a real world example?

---

<div class="post-metadata">

### Author: ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)
#### Post date: [October 26, 2017, 5:26am UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/7 "2017-10-26T05:26:18Z")

</div>

If I understand correctly, this is something I always wanted to do.  
In all social networks people subscribe. Once subscribed, the person gets exactly what he wants to see. Very convenient. Follow the categories, tags - topics (next people). Example: Quora.  
A lot of people who want this implementation.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [October 26, 2017, 5:43am UTC](https://meta.discourse.org/t/building-new-topic-lists/72772/8 "2017-10-26T05:43:38Z")

</div>

Is it not this?

> [@Topic list tabs for user-customizeable saved filters](https://meta.discourse.org/t/topic-list-tabs-for-user-customizeable-saved-filters/40953/20):
>
> We’re sponsoring a developer to work on this as a plugin. Approach #2 seems like the way to go for an MVP. I’ll post a final spec below based on @mcwumbly and @LeoMcA’s mockups. Some modifications: The primary place of interaction should be the /categories page, where a star can be clicked to favorite a category. (mockup below). I don’t think it should be added to the Notifications page. Favorites will have no effect whatsoever on notifications. I’m opting for the Interface page instead. SPE…
