تقديم ميزة "الموضوع المميز"

بالنسبة لهذه المواضيع الرائعة، يبدو أنه لا توجد طريقة لتشجيعها مثل تمييز منشوراتهم.

To highlight a topic in the topic list you can pin the topic to the top to the list. This is a native Discourse feature.

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

I know that, however in my opinion pin is for rules of this category or something like that. For me I prefer there is a way to highlight some of the topic in list or not pin them.

Can you share a mock-up of how you envision that working?

Something like that. Color and bold the topic title and with a star… just a sample, so that user can know that this topic is highlighted and featrued.

Oh cool! You can easily accomplish that with a small theme component. First create a staff tag to denote this “highlight” state, let’s say it’s “highlight”. Then you tag the topics you want to highlight with this tag.

On the theme code you need to style it as you want let’s say:

tr.tag-highlight {
    background-color: blue;
    font-weight: bold;
    border: 3px dotted pink;
}

Then it looks like this:

6 إعجابات

I know how to do it in css, that sample is actually working on my discourse. I just want to know is that possible to build in this function in official? I think highlight is a pretty useful function.

3 إعجابات

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

لقد حاولت القيام بذلك، ويبدو أنه قد يعمل، ولكني ربما أفعل ذلك بشكل خاطئ.

.title-wrapper div.has-highlight {
  /* Styles for the <h1> with the class */
  color: blue !important;
  font-weight: bold;
}
إعجاب واحد (1)

ما هو “الموضوع نفسه” في هذا السياق؟

في صفحة الموضوع للمواضيع التي تحمل علامة، أريد تنسيق الموضوع بلون مختلف (أو أي شيء آخر) بحيث يظهر بشكل خاص ليس فقط في قوائم المواضيع، ولكن أيضًا عند زيارة صفحة الموضوع.

أوه تقصد أول مشاركة في موضوع، المشاركة الأصلية، صحيح؟

body.tag-highlight article#post_1 {
    background-color: blue;
    font-weight: bold;
    border: 3px dotted pink;
}
إعجاب واحد (1)

هذا رائع! الآن كيف أستهدف عنوان الموضوع؟


// هذا يستهدف الوسم نفسه
a[data-tag-name="extra-special-topic"] {
    color: yellow !important;
}

// هذا يغير العنوان في قوائم المواضيع
.tag-extra-special-topic .raw-topic-link {
    color: blue !important;
}

// هذا يستهدف الخلفية/جسم الموضوع الأصلي
body.tag-extra-special-topic article#post_1 {
    background-color: blue;
    font-weight: bold;
    border: 3px dotted pink;
}
.tag-extra-special-topic #topic-title .fancy-title {
  color: papayawhip;
}

صديقي العزيز، هل جربت النهج الذي اقترحوه؟ يجب أن أعترف، لقد أفلت شرحهم من فهمي. :rofl:

أي جزء؟ أنت فقط تفتح محرر السمة الخاص بك وتعدل CSS

لقد فعل هذا شيئًا غريبًا بالنسبة لي، عندما أكون في الموضوع المميز، فإنه ينطبق بعد ذلك على مواضيع أخرى في الأسفل في قائمة “المواضيع الجديدة وغير المقروءة”

ولكن إذا لم أكن في الموضوع، فإن الموضوع المميز فقط هو المميز (كما تتوقع)

ما القصة مع ذلك :lol:؟