איך להשיג פריסת צד-צד לנושאי הודעות כמו זו?

סיכום מבוסס בינה מלאכותית

User lilstranded seeks to implement a side-by-side layout in Discourse, with post author details on the left and content on the right, as opposed to the default vertical stack. Initial suggestions include using CSS Flexbox NateDhaliwal, but Canapin notes it can’t be done with CSS alone and would require a theme component. lilstranded confirms CSS tinkering broke the layout. After clarification, manuel agrees CSS alone won’t suffice due to template structure, referencing Epic forums as an example. Arkshine reverse-engineers the Epic layout and shares a working theme component that repositions widgets and adjusts CSS, with a note that post count requires a separate plugin Arkshine. lilstranded confirms success and thanks Arkshine with a celebratory GIF.

I would love to achieve a side-by-side layout for my Discourse instance (see attached image). Could anyone please guide me on how to do this? I appreciate any help you can provide!

קופסאות גמישות ב-CSS, אולי? רק מפסגת המחשבות שלי. ואז אולי להשתמש ב-API/requests כדי למשוך נתונים נוספים כמו ספירת הפוסטים.

מה שאתה רוצה זה בעיקר להחליף את הפסים האופקיים בפסים אנכיים?
אפשר לעשות את זה עם רכיב נושא, ולא ניתן לעשות את זה באמצעות CSS בלבד.
זה ידרוש זהירות כדי לא לשבור כלום, ויכול להיות לא טריוויאלי לעשות את זה :-thinking:

ניסיתי קצת לשחק עם Flexbox בסיסי, אבל זה רק שבר את הפריסה.

שלום @Canapin! למעשה, אני רוצה Shkoyot the post author בצד שמאל ופרטי תוכן הפוסט בצד ימין במקום שהם יהיו זה על זה כמו בפריסת discourse הסטוקית.
זה יהיה מועיל אם קיימים תוספים לכך.

I’d agree, you can’t re-position these items in a clean way with CSS. The avatar and the default metadata are arranged separately on the template:

I wonder how it’s actually done on the Epic forums. Is this a template override? I don’t see any plugin outlet at this location:

ממה שאני רואה, הם הוסיפו מחדש את הנתונים (שם משתמש וכו’) לאחר התוכן של הווידג’ט post-avatar, הוסיפו רוחב ל-.topic-avatar, והם מסתירים הכל עם CSS פרט לתאריך. ננסה לראות אם אני יכול לשחזר את זה.

You can try this basic theme component: GitHub - Arkshine/discourse-topic-avatar-vertical-layout · GitHub.

Let me know if you see issues.


  1. It moves the poster-name widget under the post-avatar widget. No other changes apart from CSS adjustments. ↩︎

That worked like a charm! Thanks a lot, buddy.