# 모바일에서 카테고리 및 '최신'을 어떻게 볼 수 있나요?

**URL:** https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489
**Category:** Support
**Created:** [3월 23, 2025, 12:28오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489 "2025-03-23T12:28:59Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Aurora](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aurora/32/523140_2.png) [@Aurora](https://meta.discourse.org/u/Aurora)
#### Post date: [3월 23, 2025, 12:28오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489/1 "2025-03-23T12:28:59Z")

</div>

모바일에서 카테고리와 "최신"을 어떻게 볼 수 있나요?

이렇게요?

 ![Let's Talk 앱 스크린샷으로 "Self-Care Lounge", "Community Events", "My Groups" 탭이 표시되어 있으며, "Latest" 아래에서 "Marriage issue 💖 Mental Health Conditions 5 depression" 게시물이 강조되어 있습니다. 이 게시물은 신혼인 남편과 가족 간의 갈등에 대한 경험을 설명하고 있습니다. (AI에 의해 캡션됨)](https://global.discourse-cdn.com/meta/original/4X/c/0/4/c0413a613c59957c01a74c4621e95169b9bebd32.jpeg)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [3월 23, 2025, 6:05오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489/3 "2025-03-23T18:05:39Z")

</div>

확인해 보니, “카테고리와 최신 주제” 뷰를 강제하기 위해 커스텀 JS 코드를 사용했습니다.

더 나은 방법이 있는지 확인하지는 않았지만, 그들이 사용하는 방법은 다음과 같습니다 (코드를 현대화하고 몇 가지 주석을 추가했습니다):

```js
import { apiInitializer } from "discourse/lib/api";
import CategoriesAndLatestTopics from "discourse/components/categories-and-latest-topics";
import CategoryList from "discourse/models/category-list";
import { MAX_UNOPTIMIZED_CATEGORIES } from "discourse/lib/constants";

export default apiInitializer((api) => {
  // "카테고리와 최신 주제" 뷰를 강제합니다.
  api.modifyClass(
    "component:discovery/categories-display",
    (Superclass) =>
      class extends Superclass {
        get categoriesComponent() {
          if (this.args.parentCategory) {
            return super.categoriesComponent;
          } else {
            return CategoriesAndLatestTopics;
          }
        }
      }
  );

  // 원본과 동일하지만 "this.site.desktopView" 체크를 약간 수정하여,
  // 모바일에서도 최신 주제를 찾을 수 있도록 했습니다.
  api.modifyClass(
    "route:discovery-categories",
    (Superclass) =>
      class extends Superclass {
        async findCategories(parentCategory) {
          let model;

          let style = this.siteSettings.desktop_category_page_style;
          if (this.site.categories.length > MAX_UNOPTIMIZED_CATEGORIES) {
            style = "categories_only";
          }

          if (
            style === "categories_and_latest_topics" ||
            style === "categories_and_latest_topics_created_date"
          ) {
            model = await this._findCategoriesAndTopics(
              "latest",
              parentCategory
            );
          } else if (style === "categories_and_top_topics") {
            model = await this._findCategoriesAndTopics(
              "top",
              parentCategory
            );
          } else {
            PreloadStore.remove("topic_list");
            model = await CategoryList.list(this.store, parentCategory);
          }

          return model;
        }
      }
  );
})

```

새로운 컴포넌트 → 코드 편집 → JS 탭에 이 코드를 붙여넣어 보세요.  
도움이 되는지 알려주세요.

---

<div class="post-metadata">

### Author: ![Aurora](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aurora/32/523140_2.png) [@Aurora](https://meta.discourse.org/u/Aurora)
#### Post date: [3월 26, 2025, 2:35오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489/4 "2025-03-26T14:35:47Z")

</div>

매우 감사합니다. 시도해 봤지만 아무 변화가 없었습니다. 🤔

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [3월 26, 2025, 2:57오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489/5 "2025-03-26T14:57:19Z")

</div>

다음 사항들을 확인해 주세요:

- 코드가 JS 탭에 있는지 (다른 곳에 있지 않은지)
- 코드가 활성화되어 있는지 (TC를 생성했다면 테마에 연결되어 있는지 확인)
- `desktop_category_page_style` 사이트 설정이 `categories_and_latest_topics`로 되어 있는지
- 브라우저 콘솔에 오류가 있는지

왜 아무 반응이 없는지 함께 찾아보겠습니다.

---

<div class="post-metadata">

### Author: ![Aurora](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aurora/32/523140_2.png) [@Aurora](https://meta.discourse.org/u/Aurora)
#### Post date: [3월 26, 2025, 3:48오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489/6 "2025-03-26T15:48:23Z")

</div>

![Bildschirmfoto 2025-03-26 um 16.47.07](https://global.discourse-cdn.com/meta/original/4X/b/9/9/b99b7bbbcb0284b746766248bc6c9d83e1d2cca1.png)

저는 이렇게 모두 수행했습니다. 복사한 것이 정확한가요?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [3월 26, 2025, 3:49오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489/7 "2025-03-26T15:49:36Z")

</div>

중복된 항목을 제거할 수 있습니다. 작동하지 않는 이유가 바로 이것일 가능성이 높습니다(이 5줄):

 ![이미지는 라이브러리에서 `apiInitializer` 함수를 가져오는 import 문과 사용자 코드를 추가해야 할 위치를 나타내는 플레이스홀더 텍스트가 포함된 export default 선언을 보여줍니다. (AI 캡션)](https://global.discourse-cdn.com/meta/original/4X/e/7/0/e700fd2b09e7206884a0b23a54da5f2d41c8cc58.png)

---

<div class="post-metadata">

### Author: ![Aurora](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aurora/32/523140_2.png) [@Aurora](https://meta.discourse.org/u/Aurora)
#### Post date: [3월 26, 2025, 6:21오후 UTC](https://meta.discourse.org/t/how-can-i-view-categories-and-latest-on-mobile/358489/8 "2025-03-26T18:21:27Z")

</div>

이제 뭔가 나올 것 같은데! 근데 “모던 카테고리 및 그룹” 기능을 쓰면 안 돼요.

😅

 ![The image is a screenshot of a digital outreach page with text in German featuring two blog posts related to neurodiverse self-help groups. (Beschriftet durch KI)](https://global.discourse-cdn.com/meta/original/4X/5/4/9/549a10a9089ec720c35bebdc16eed1084dbfa742.jpeg)

 ![This image shows an interface with three pop-up windows featuring illustrations and text about different types of regions, including a support group, a community network, and an offline region. (Beschriftet durch KI)](https://global.discourse-cdn.com/meta/original/4X/a/7/2/a72531721725f4ced1526536885290291418d765.jpeg)
