I’m looking to get a topic’s category id to use in javascript. Since this info is already being pulled to grab the category tag in each topic for handlebars, I was wondering if I could use that somehow?
A likely helpful piece of code could be this:
Discourse.TopicRoute.on("setupTopicController", function(event) { // Access the controller via: event.controller // Access the model via: event.currentModel });
Thanks for this @joebuhlig. So you think if you reopen the TopicRoute, we should be ble to get the topic with var topic = this.modelFor('topic'); and then the rest with topic.category.id?