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:
Basically the red box on the left should be clickable:
If you want to experiment and fork this component, you are welcome to do so
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…
لقد اعتمدنا على هذه المكونة لجعل بطاقات الموضوعات في عرض الفئات + الأحدث (الافتراضي في حالتنا) قابلة للنقر. منذ تحديث اليوم إلى أحدث إصدار 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;
}
مرحباً @kinetiksoft - لم أتمكن من إعادة إنتاج المشكلة من جهتي. يبدو أن مكون السمة يعمل بشكل جيد مع أحدث إصدار من Discourse. استخدام رابط “المعاينة في منشئ السمة” في المنشور الأصلي هنا يبدو أنه يعمل أيضاً.
هل يمكنك مشاركة رابط لموقع به المشكلة؟ ربما هناك تعارض مع سمة/إضافة أخرى.
لست متأكدًا مما إذا كان هناك خطأ في إعدادي لمكون السمة هذا، ولكن النص الأساسي بالكامل في الموضوع الموجود على البطاقة غير قابل للنقر عليه. إذا نقرت مباشرة بعد انتهاء النص في أي سطر، يمكنك تنشيط البطاقة وفتح الموضوع.