클릭 가능한 주제

:discourse2: 요약 Clickable Topic은 주제 제목뿐 아니라 topic-list-item의 전체 영역을 클릭 가능하게 만듭니다.
:eyeglasses: 미리보기 Discourse Theme Creator에서 미리보기
:hammer_and_wrench: 저장소 링크 https://github.com/discourse/discourse-clickable-topic
:open_book: Discourse 테마에 처음이신가요? Discourse 테마 사용 입문 가이드

이 테마 컴포넌트 설치

기능

preview

:discourse2: 우리가 호스팅하나요? 테마 컴포넌트는 Standard, Business, Enterprise 플랜에서 사용할 수 있습니다.

46개의 좋아요

Thank you so much, very needed thing! :heart:

4개의 좋아요

That is a very helpful component! Should be from user experience point of view built into Discourse, but that is my opinion.

Anyways, I’m stuck in trying to make the same logic work for Categories. I wanted to do it with api.modifyClass but seem to miss the crucial part. Can you please help me?

I have this setting for my desktop page:
image

Basically the red box on the left should be clickable:

Or to have a perfect picture what I want to achieve: recreating the Blizzard Forum design, cause I like it a lot:

Appreciate any help here.

While waiting for a response I also found the components page here:
https://github.com/discourse/discourse/tree/master/app/assets/javascripts/discourse/app/components
And tried different ideas but it seems my hook is not even available? Or I’m missing something!? :slight_smile:

Glad you like the component!

Thanks for the suggestions :grinning_face_with_smiling_eyes:

At the moment this component is only designed to work for Topics in a topic list.

1개의 좋아요

If you want to experiment and fork this component, you are welcome to do so :+1:

As a starting point to get a category to be clickable, I would suggest looking through the code in this component that does so by modifying the topic-list-item component inside Discourse core.

You could try creating a new file within this same folder which targets one of the many types of category layouts included in our components, making sure to target the same category page style you have selected on your forum.

Some of these are listed in their locations below…

app/assets/javascripts/discourse/app/components/categories-and-latest-topics.js
app/assets/javascripts/discourse/app/components/categories-and-top-topics.js
app/assets/javascripts/discourse/app/components/categories-boxes-topic.js
app/assets/javascripts/discourse/app/components/categories-boxes-with-topics.js
app/assets/javascripts/discourse/app/components/categories-boxes.js
app/assets/javascripts/discourse/app/components/categories-only.js
app/assets/javascripts/discourse/app/components/category-list-item.js

3개의 좋아요

The preview does not work anymore

2개의 좋아요

I think that should be okay now. :slightly_smiling_face::+1:

2개의 좋아요

Broken now.

We relied on this component to make Categories + Latest view (default in our case) topic cards clickable. Since today’s update to the latest 3.1.0beta8 (now it shows as 3.2.0.beta1-dev), the component stopped working correctly.

Now the active state of the cursor remains as clickable, but topic area is not clickable. With browser’s console opened there’s an error, which may help developers to identify the problem:

Uncaught TypeError: this.router is undefined

function navigateToTopic(topic, href) {
    if (this.siteSettings.page_loading_indicator !== "slider") {
      // With the slider, it feels nicer for the header to update once the rest of the topic content loads,
      // so skip setting it early.
      this.appEvents.trigger("header:update-topic", topic);
    }
    this.session.set("lastTopicIdViewed", {
      topicId: topic.id,
      historyUuid: this.router.location.getState?.().uuid
    });
    _url.default.routeTo(href || topic.get("url"));
    return false;
  }

The error thrown for line:

historyUuid: this.router.location.getState?.().uuid

May it be related to Ember upgrades planned/ongoing in the core?

Hi @kinetiksoft - I haven’t been able to reproduce the problem on my end. The theme component seems to work well against the latest version of Discourse. Using the ‘preview on theme creator’ link in the OP here seems to work as well.

Could you share a link to a site with the problem? Perhaps there is clash with another theme/plugin.

2개의 좋아요

Thank you! I’ve PM’ed you a link to the community in question. It’s not appropriate to share it in public.

1개의 좋아요

Thanks @kinetiksoft! Looks like the problem happens when the theme component is used alongside the ‘categories + latest’ view (which you have configured as your homepage).

I’ve made a PR which should solve the problem.
https://github.com/discourse/discourse/pull/22992

I’ll post here once it’s merged, and then you’ll need to update your forum to the latest version of Discourse core.

3개의 좋아요

Thank you David! Glad we could help identifying the issue in perfectly working component

2개의 좋아요

All done - so it should take effect next time you update to the latest version of Discourse

1개의 좋아요

We will do update attempt later this week and I will certainly come back to this topic to report how everything is going. Thank you again!

1개의 좋아요

We can confirm the issue has been fixed. Thank you again! :heart:

1개의 좋아요

Hi, how can I modify this component to support the Docs plugin?

최신 Discourse 3.4.0.beta2-dev 버전을 사용하고 있습니다.


이 테마 컴포넌트의 설정에 문제가 있는지 확실하지는 않지만, 카드 안의 토픽 본문 텍스트가 클릭되지 않습니다. 텍스트가 끝난 직후의 어느 한 줄을 클릭하면 카드를 활성화하여 토픽을 열 수 있습니다.

이 문제의 원인이 무엇일지 혹시 아는 분이 계신가요?

미리 도움을 주셔서 감사합니다. :slight_smile:

4개의 좋아요

안녕하세요, TC님, 조언해 주셔서 감사합니다. 하지만 여전히 클릭이 되지 않는 영역이 있는 것 같습니다?

관리 중인 사이트에서 이 오류가 간헐적으로 발생하고 있습니다:

Discourse 52ab90911Clickable Topic 37f0aa135fe를 사용 중입니다.

업데이트: 최근에는 사이트 설정에 아무런 변경 사항이 없었음에도 불구하고 이 문제가 다시 발생하지 않았습니다. 제가 이 문제를 확인했을 당시에는 페이지가 완전히 렌더링되기 전에 너무 빠르게 클릭한 것 같습니다. 이제 보고를 했으니, 의미 있는 정도로 재현할 수 있게 된다면 더 자세한 정보를 가지고 다시 찾아오겠습니다.

1개의 좋아요