How should subcategory show its parent category?


(Kane York) #1

Here’s something I hacked together in Chrome’s inspect element/developer console:

<td class="category">
  <span class="badge-category" style="background-color: #e9dd00; color: #000000; padding: 5px 7px;"><a href="/category/bug" class="badge-category" title="Bug reports on Discourse. Do be sure to search prior to submitting bugs. Include repro steps, and only describe one bug per topic please." style="
    padding-left: 0;
    color: #000000;
">bug</a><a style="
    background-color: green;
    padding: 2px 3px;
    /* font-size: 90%; */
" class="badge-category">complete</a>
</span>
</td>

I think that this - including the parent category name - would help for several workflows, not the least of which is that shown above (bug tracking).

I was prompted to do this by the wart in this topic:

See that [REL] in the title there? Yeah. That’s ugly. I think it would be better if they could use a category like this:

(Modding: Release as opposed to “Modding: discussion”, etc.)

We should probably have some subcategories here on Meta to do testing of the codepaths for subcategories…

For example, the “bug: open” and “bug: complete” categories featured above, where “bug: complete” has permissions of everyone can reply/see. (Actually, does that forbid moving topics into the category? I’ll test and report back…)


Sub-categories not displayed correctly
(Jeff Atwood) #2

Seems reasonable, but definitely puts a burden on the people picking colors as all subcategory colors need to be visually compatible with the parent category.


(M B) #3

The site is already too boxy IMO. This will just add one more point of visual contention. Why not put the status in parentheses and change the background of the parent tag?


(Jacob) #4

Definitely agree with too boxy.


(Sam Saffron) #5

Boxes within boxes is a bit M C Escher for my taste. Busy, does not scale to long category names.


(Trevor Williams) #6

Doesn’t scale, agreed. Good idea though, but meh.


(Jeff Atwood) #7

@pakl also had this proposal which I thought had some merit


(Dave McClure) #8

emphasis mine

I think that appending the name is all that is necessary. Make the color one color, and allow it to be set at the subcategory level, if desired.

If you define a color for a subcategory, it overrides that color for the category… otherwise it inherits the category color (like the subcategory wip as illustrated below).


(Jeff Atwood) #9

Still might be a problem, as very long category names basically force two lines, or force everything significant out of the primary topic line.

I kind of prefer the overlap proposal to minimize the amount of space used. The first character or two of the parent should be sufficient to see what you’re dealing with.


(Dave McClure) #10

hmm… ok, i see what you’re getting at.

Here’s another thought:

  1. add a setting for “show_subcategory_on_main_topic_page”.
    - it should be off by default, IMHO and just show the main category
    - when on, there is one more column for subcategory, to the right of category (or perhaps it shows the subcateogry instead of the main one, as it does today to save space… or does what you’re describing with the overlap… )
  2. on a category page, show the subcategory in a column of its own, at least when “all subcategories” is selected

(Kris) #11

Something like this could grant some extra functionality there


(Bill Ayakatubby) #12

I like it, but it isn’t intuitive/discoverable on touch devices.


(Patrick Klug) #13

I don’t think that this is ideal. One of the reasons I wanted to visually prepend the parent category is to get around a situation where I have two sub-categories with the same name and color. Example: Product 1/ bugs and Product 2/bugs. If you simply color them based on the bugs category then they will likely show both as pure red. I think it’s better to have the color of the parent category as part of the visual presentation, hence my original suggestion (as ugly as it is in the mockup):


(Dave McClure) #14

Is it the consensus that the subcategory label should dominate the label of the parent category? I can understand it, if so, but it seems not-so-obvious to me, hence this later proposal


(Jeff Atwood) #15

I moved 2 posts to an existing topic: Shouldn’t you be able to tag with multiple categories?


(Dave McClure) #16

I’m bumping my proposal here.

We are starting to set up discourse as a single forum to support multiple products. I would like to have a simple categorization system like:

  • product a
    • feature
    • bug
    • support
  • product b
    • feature
    • bug
    • support

I’d like to just see ‘product a’ or ‘product b’ as the badge when you’re on the latest page. And then if you’re on ‘product a’ / ‘all subcategories’ you can see ‘feature’, ‘bug’ and ‘support’

Seeing ‘feature’ on the front page will not be very helpful without knowing which product its related to…

Or am I thinking about this all wrong? Perhaps it’d be better to solve this by creating 2 separate forums in this case? I pitched that idea here but folks were more inclined to have a single forum…


Should you be able to create subcategories with the same name as ones under another category?
(Jeff Atwood) #17

We definitely need to figure out a way to display this. It is not good that subcategory and category look the same.


(Dave McClure) #18

I just realized my use case is exactly what @pakl described above (I read that a long time ago). I think his mockup is worth pursuing, I would just not try to show any of the text from the parent category.

Perhaps just a sliver of color from the parent category would be enough?


Some ideas to clean up topic list menu buttons on mobile layout
Should you be able to create subcategories with the same name as ones under another category?
(Jacob) #19

I use the same color for sub-categories as my main category.


(Jeff Atwood) #20

I like that, what do you think @awesomerobot?