# 토픽 목록에서 하위 카테고리를 숨기되, 해당 카테고리의 토픽은 숨기지 않는 방법?

**URL:** <https://meta.discourse.org/t/hide-subcategories-without-hiding-their-topics-in-topic-list/195502>\
**Category:** Support\
**Created:** [6월 30, 2021, 3:05오후 UTC](https://meta.discourse.org/t/hide-subcategories-without-hiding-their-topics-in-topic-list/195502 "2021-06-30T15:05:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)\
**Post date:** [6월 30, 2021, 7:25오후 UTC](https://meta.discourse.org/t/hide-subcategories-without-hiding-their-topics-in-topic-list/195502/2 "2021-06-30T19:25:08Z")

</div>

토픽 목록의 항목 템플릿은 다음과 같이 토픽의 카테고리 링크만 표시합니다:  
`{{category-link topic.category}}`

따라서 상위 카테고리 링크를 표시하려면 이 템플릿을 수정해야 합니다:

```plaintext
{{#if topic.category.parentCategory}}
  {{category-link topic.category.parentCategory}}
{{else}}
  {{category-link topic.category}}
{{/if}}

```

하지만 특정 상위 카테고리에 대해서만 이렇게 하려면 더 많은 로직을 추가해야 합니다. 이를 위한 권장 방식이 무엇인지, 핸들바 헬퍼를 등록하는 것이 좋은지 저는 잘 모르겠습니다.

다른 방법으로는 항상 카테고리 및 상위 링크를 모두 표시한 후, CSS를 사용하여 표시하지 않으려는 링크를 숨기는 방식을 사용할 수 있습니다.

---

_[View the full topic](https://meta.discourse.org/t/hide-subcategories-without-hiding-their-topics-in-topic-list/195502)._
