Extra Sub-category Data in Categories listing


#1

The Discourse Categories page lists categories like this out of the box:

Category
 | ■ Sub-Category   ■ Sub-Category  |  Latest Topic                       |
 | ■ Sub-Category   ■ Sub-Category  |  Latest Topic                       |
 | ■ Sub-Category                   |  Latest Topic                       |

As someone who has many sub-categories I want to instead achieve this:

Category
 | ■ Sub-Category            |  Latest Topic   | By User  |  # of Replies | 
 | ■ Sub-Category            |  Latest Topic   | By User  |  # of Replies | 
 | ■ Sub-Category            |  Latest Topic   | By User  |  # of Replies | 
 | ■ Sub-Category            |  Latest Topic   | By User  |  # of Replies | 
 | ■ Sub-Category            |  Latest Topic   | By User  |  # of Replies | 

So I intend to override discovery/categories.hbs in the Admin Interface but the problem I run into is the model data is pretty limited. I am pretty sure I need to interact with each /c/<category-slug>/<sub-category-slug>.json to make this work.

Suggestions? Following Discourse ideals and modularity makes this trivial task a little more difficult.


EDIT: After chatting with with @riking, he suggested a plugin is necessary for this to be efficient. Is there a plugin out there that has achieved something similar or at least something similar in theory?


(Sam Saffron) #2

Nope, but you can see how tagger adds data to serializers, this is a huge change. Essentially you need to completely change the behavior of the serializer / controller and caching structures. To me this feels like a new endpoint and new page.