Showing parent category label and sub-category label


(Tom Wrench) #1

On the ‘latest’ page, if there is a topic in a subcategory it only displays the label of the subcategory it’s in.

Is there a way to show both the parent category and subcategory labels in this instance, as I may have multiple subcategories with the same name but under different parent categories, so it could get confusing.

Cheers


(Stefano Costa) #2

There should be a subtle hint in the coloring of labels, e.g. on the left of the category label you should see a patch in the same color of the parent category. Example from my forum:

The second topic is in a subcategory of Eventi (that you can see in the third topic), and the small green rectangle is an indication of that. This is with the “category style” setting set to “box”.


(Tom Wrench) #3

I do see this. However, if there are a decent number of categories/subcategories it’s not clear to the user what category the ‘subtle hint’ in the colouring of labels represents. It would be great to be able to show labels for both the parent category and subcategory in these cases.

I was hoping it would be perhaps a CSS hack?


(Mittineague) #4

There is CSS that you could try though not exactly what you’re hoping for. eg.

<a class="badge-wrapper box"
 href="/community/c/python-perl-and-golang/python">
 <span class="badge-category-parent-bg"
  style="background-color: #A45BC7;"></span>
 <span class="badge-category-bg"
  style="background-color: #1a69ca;"></span>
 <span style="color: #FFFFFF;"
  data-drop-close="true"
  class="badge-category clear-badge" title="Discussion about the popular interpreted language for web, scientific and mathematical programming, based on the &quot;One Obvious Way To Do It&quot; philosophy.">Python</span>
</a>

If you change the “5px” values for badge-category-bg from

left: 5px; 
width: calc(100% - 5px);

to 10 px you get a side stripe twice as wide