トピック一覧にトピック作成者を表示

Hello!

I would like to change the topic list to only display the topic’s author instead of a list of frequent posters in a topic.

Would there be an easy way to accomplish this?

EDIT: Here’s a more complete solution I threw together that you can download as a theme component:

「いいね!」 8

@tshenry, awesome, I am looking for a similar solution but i would like to display the poster username instead of their image.

Where could we take a look into the repo of your component?

Ah! I definitely goofed by failing to provide a way to download or see the code! It’s just some CSS. I’ll bundle it into a proper theme component on GitHub when I get a chance.

// Hide all posters except the topic author
.topic-list .posters {
    width: 75px;
    text-align: center;
    
    // Only show first poster
    a:not(:first-of-type) {
        display: none;
    }
    // Get rid of offset and decoration
    a:first-child .avatar.latest:not(.single) {
        position: static;
        box-shadow: none;
        border: 0;
    }
    // Adjustment for center alignment
    & > a {
        float: none;
        margin-right: 0;
    }
}

// Make sure the correct user is showing at smaller width
@media screen and (max-width: 850px) {
    .topic-list td.posters {
        // Ensure first poster is showing
        a:not(.latest) {
            display: block;
        }
        // Hide everything else
        a:not(:first-of-type) {
            display: none;
        }
    }
}

What you are trying to accomplish is probably closer to:

「いいね!」 4

本当に素晴らしいです!ありがとうございます。

モバイル用の CSS コードがうまく動作していないようです。Discourse は最近、モバイルでの投稿者のレイアウト方法をに変更しましたか?これを修正するためのヒントはありますか?

ありがとうございます!

上記の CSS はモバイル向けに意図されたものではありませんでしたが、おそらくこれが探しているものだと思いますか?

「いいね!」 1

はい!モバイルテーマでは、あなたのCSSコードのように、特定のカテゴリに対してOP専用レイアウトをCSSで制限することができませんでした。モバイルでそれを達成するためのヒントはありますか(すみません、Ember.jsは初心者なので…)?

残念ながら、カテゴリで絞り込む機能は、そのモバイルコンポーネントにとってやや大きな追加作業になります。なぜなら、カテゴリの判定はハンドルバーファイル単独ではできないからです。以下のような対応方法があります。

  • Dev トピックを作成し、開発者からヒントを得られるか確認する
  • カテゴリに関連する既存のテーマコンポーネントのコードを調べ、アイデアやヒントを探す
  • Marketplace に依頼を投稿し、誰かに作成を依頼する
「いいね!」 2