# 테마 컴포넌트를 통해 카테고리 이름을 변경하는 방법

**URL:** https://meta.discourse.org/t/how-to-change-category-names-via-theme-component/279742
**Category:** Development
**Created:** [9월 22, 2023, 4:54오전 UTC](https://meta.discourse.org/t/how-to-change-category-names-via-theme-component/279742 "2023-09-22T04:54:34Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Rhababo](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@Rhababo](https://meta.discourse.org/u/Rhababo)
#### Post date: [9월 29, 2023, 6:00오후 UTC](https://meta.discourse.org/t/how-to-change-category-names-via-theme-component/279742/2 "2023-09-29T18:00:31Z")

</div>

첫 번째 부분에 대해, 기존 카테고리 제목에 항목을 추가하는 것이므로 플러그인 컴포넌트를 통해 추가 HTML을 삽입할 수 있는 몇 가지 위치가 있습니다:

 ![Screenshot 2023-09-29 at 12.15.58 PM](https://global.discourse-cdn.com/meta/original/4X/a/4/3/a43ccf9f851bb70cfb1ff306bc5398b3fc64a967.png)

다음 테마 컴포넌트를 사용하면 사이트에 어떤 위치에 요소를 입력할 수 있는지 파악하는 데 도움이 됩니다:

> **[GitHub - communiteq/plugin-outlets-theme-component](https://github.com/communiteq/plugin-outlets-theme-component)**
>
> Contribute to communiteq/plugin-outlets-theme-component development by creating an account on GitHub.

플러그인 아웃렛에 항목을 추가하는 방법에 대해 더 자세히 설명한 섹션은 다음과 같습니다:

> [@Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648#):
>
> Discourse Themes and Theme Components can be used to customize the look, feel and functionality of Discourse’s frontend. This section of the developer guides aims to provide all the reference materials you need to develop simple themes for a single site, right up to complex open-source theme components. This introduction aims to provide a map of all the tools and APIs for theme development. If you prefer a step-by-step tutorial for theme development, jump straight to: Themes vs. Theme Compon…

사이드바의 이름을 변경하는 문제에 대해서는… 이를 제어하는 코드는 다음과 같습니다:

> <https://github.com/discourse/discourse/blob/5f3265fe017d06fb165d0fd6ef668c813b830e65/app/assets/javascripts/discourse/app/lib/sidebar/user/categories-section/category-section-link.js#L186C1-L188C4>

이 함수를 다음과 같이 오버라이드하면

```plaintext
get text(){
    return "..."+this.category.name.substr(-10)

```

작동할 수 있지만, 이는 템플릿 외부에서 코어 자바스크립트를 수정해야 한다는 것을 의미합니다. 이러한 작은 변경 사항은 장기적으로 무해할 수 있지만, discourse가 업데이트될 때 어려움을 겪을 수 있습니다.

저보다 더 통찰력이 있는 누군가가 의견을 주길 원한다면, 그들의 말을 따를 것입니다.

---

_[View the full topic](https://meta.discourse.org/t/how-to-change-category-names-via-theme-component/279742)._
