# הצגת תווית קטגוריה ראשית ותת-קטגוריה

**URL:** https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746
**Category:** Development
**Created:** [30 במרץ,‏ 2016,‏ 6:28am UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746 "2016-03-30T06:28:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tomwrench](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomwrench/32/54576_2.png) [@tomwrench](https://meta.discourse.org/u/tomwrench)
#### Post date: [30 במרץ,‏ 2016,‏ 6:28am UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746/1 "2016-03-30T06:28:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![steko](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@steko](https://meta.discourse.org/u/steko)
#### Post date: [30 במרץ,‏ 2016,‏ 11:03am UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746/2 "2016-03-30T11:03:11Z")

</div>

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:

 ![](https://global.discourse-cdn.com/meta/original/3X/d/f/df6424ffa3f417da76e0f726a8cfd6d5cabdd848.png)

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”.

---

<div class="post-metadata">

### Author: ![tomwrench](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomwrench/32/54576_2.png) [@tomwrench](https://meta.discourse.org/u/tomwrench)
#### Post date: [31 במרץ,‏ 2016,‏ 4:55am UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746/3 "2016-03-31T04:55:28Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [31 במרץ,‏ 2016,‏ 5:20am UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746/4 "2016-03-31T05:20:02Z")

</div>

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

```plaintext
<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

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

```

to 10 px you get a side stripe twice as wide

---

<div class="post-metadata">

### Author: ![dan-barbulescu](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@dan-barbulescu](https://meta.discourse.org/u/dan-barbulescu)
#### Post date: [28 באוקטובר,‏ 2020,‏ 8:17pm UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746/6 "2020-10-28T20:17:32Z")

</div>

Is there still no way to make this happen?

The “subtle hint” is _too_ subtle some of our users.

---

<div class="post-metadata">

### Author: ![elRicharde](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@elRicharde](https://meta.discourse.org/u/elRicharde)
#### Post date: [5 בספטמבר,‏ 2024,‏ 9:35am UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746/7 "2024-09-05T09:35:41Z")

</div>

it´s solved by now

> [@How to show Category Hierarchy in Topic-List with CSS](https://meta.discourse.org/t/how-to-show-category-hierarchy-in-topic-list-with-css/325060):
>
> Hi Everyone and thanks for your time to read. I´ve searched the forum for hours and tried a bit with chat gpt and a testforum but i need some help here. In our ngo we want to rearange our categorys so that each department has its own category with 3 Subcategories: So Basically generic like: Topcategory = Name of department Subcategories: news questions internal If you imagine having 10 or more departments writing news, you´ll can´t see from who is the news in result-list, becau…

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [5 בספטמבר,‏ 2024,‏ 9:51am UTC](https://meta.discourse.org/t/showing-parent-category-label-and-sub-category-label/41746/8 "2024-09-05T09:51:54Z")

</div>


