Hook for a topic's category id?

Here’s how I’m doing it in the feature voting plugin:

https://github.com/joebuhlig/discourse-feature-voting/blob/master/assets/javascripts/initializers/feature-voting.js.es6#L10

You get the topic first and then (if I remember correctly) you can do this:

topic.category.id

PS. I believe with the plugin changes, I may have some updates to do to this file.

2 Likes