موضوع قابل للنقر

:discourse2: Summary Clickable Topic makes the entire area of a topic-list-item clickable, as opposed to just the topic title.
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-clickable-topic
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

preview

:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

Last edited by @JammyDodger 2024-06-11T12:48:31Z

Check documentPerform check on document:
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:

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 إعجابات

لم تعد المعاينة تعمل

إعجابَين (2)

أعتقد أن هذا يجب أن يكون جيدًا الآن. :slightly_smiling_face::+1:

إعجابَين (2)

معطل الآن.

لقد اعتمدنا على هذه المكونة لجعل بطاقات الموضوعات في عرض الفئات + الأحدث (الافتراضي في حالتنا) قابلة للنقر. منذ تحديث اليوم إلى أحدث إصدار 3.1.0beta8 (والآن يظهر كـ 3.2.0.beta1-dev)، توقفت المكونة عن العمل بشكل صحيح.

الآن، تظل الحالة النشطة للمؤشر قابلة للنقر، ولكن منطقة الموضوع ليست قابلة للنقر. مع فتح وحدة تحكم المتصفح، يوجد خطأ قد يساعد المطورين في تحديد المشكلة:

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;
  }

الخطأ الذي تم طرحه للسطر:

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

هل يمكن أن يكون ذلك متعلقًا بترقيات Ember المخطط لها/الجارية في النواة؟

مرحباً @kinetiksoft - لم أتمكن من إعادة إنتاج المشكلة من جهتي. يبدو أن مكون السمة يعمل بشكل جيد مع أحدث إصدار من Discourse. استخدام رابط “المعاينة في منشئ السمة” في المنشور الأصلي هنا يبدو أنه يعمل أيضاً.

هل يمكنك مشاركة رابط لموقع به المشكلة؟ ربما هناك تعارض مع سمة/إضافة أخرى.

إعجابَين (2)

شكراً لك! لقد أرسلت لك رسالة خاصة برابط للمجتمع المعني. ليس من المناسب مشاركته علنًا.

إعجاب واحد (1)

شكراً @kinetiksoft! يبدو أن المشكلة تحدث عند استخدام مكون السمة جنبًا إلى جنب مع عرض “الفئات + الأحدث” (والذي قمت بتكوينه كصفحتك الرئيسية).

لقد قمت بإنشاء طلب سحب (PR) من شأنه حل المشكلة.

سأقوم بالنشر هنا بمجرد دمجه، وبعد ذلك ستحتاج إلى تحديث منتداك إلى أحدث إصدار من Discourse core.

3 إعجابات

شكرا لك ديفيد! يسعدنا أننا تمكنا من المساعدة في تحديد المشكلة في مكون يعمل بشكل مثالي

إعجابَين (2)

تم الانتهاء - لذلك يجب أن يسري المفعول في المرة التالية التي تقوم فيها بالتحديث إلى أحدث إصدار من Discourse

إعجاب واحد (1)

سنقوم بمحاولة التحديث لاحقًا هذا الأسبوع وسأعود بالتأكيد إلى هذا الموضوع للإبلاغ عن سير الأمور. شكراً لك مرة أخرى!

إعجاب واحد (1)

يمكننا تأكيد إصلاح المشكلة. شكراً لك مرة أخرى! :heart:

إعجاب واحد (1)

مرحباً، كيف يمكنني تعديل هذه المكونات لدعم إضافة المستندات؟

أنا أقوم بتشغيل أحدث إصدار من Discourse 3.4.0.beta2-dev.


لست متأكدًا مما إذا كان هناك خطأ في إعدادي لمكون السمة هذا، ولكن النص الأساسي بالكامل في الموضوع الموجود على البطاقة غير قابل للنقر عليه. إذا نقرت مباشرة بعد انتهاء النص في أي سطر، يمكنك تنشيط البطاقة وفتح الموضوع.

أي أفكار حول ما قد يسبب هذا؟

شكرًا مقدمًا على كل مساعدتكم ومدخلاتكم. :slight_smile:

4 إعجابات

مرحباً، شكراً على هذا الـ TC، ولكن يبدو أن منطقة ما لا تزال غير قابلة للنقر؟