Ok, I’ve cobbled together a solution and it seems to work. Did I do this correctly, or am I doing terrible things? ![]()
<script type="text/discourse-plugin" version="0.8">
// Modify the topic route.
api.modifyClass('route:topic', {
beforeModel( transition ) {
var params = this.paramsFor('topic');
// English
if( params['id'] == 123 ) {
this.router.transitionTo('/c/tutorials/english/29'); // Implicitly aborts the on-going transition.
}
// French
if( params['id'] == 456 ) {
this.router.transitionTo('/c/tutorials/french/30'); // Implicitly aborts the on-going transition.
}
}
});
</script>