Afficher l'auteur du sujet dans la liste des sujets

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 « J'aime »

@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 « J'aime »

C’est super cool. Merci !

Le code CSS pour mobile ne semble pas fonctionner. Discourse a-t-il récemment changé la façon dont il organise les auteurs pour mobile ? Des conseils sur la façon de corriger cela ?

Merci !

Le CSS ci-dessus n’a jamais été conçu pour les appareils mobiles, mais je pense que c’est probablement ce que vous recherchez ?

1 « J'aime »

Oui ! Je n’ai pas pu limiter cette mise en page réservée aux seuls auteurs du sujet à des catégories spécifiques via CSS avec le thème mobile, contrairement à ce que permet votre code CSS. Auriez-vous des conseils pour y parvenir sur mobile (désolé, je débute avec Ember.js :/) ?

Malheureusement, limiter par catégorie constituerait un ajout assez important à ce composant mobile, car vous ne pouvez pas vérifier la catégorie uniquement avec le fichier Handlebars. Voici quelques options possibles :

  • Créez un sujet dans Dev pour voir si des développeurs peuvent vous donner des pistes.
  • Explorez le code de composants de thème existants qui concernent les catégories pour trouver des idées ou de l’inspiration.
  • Publiez une annonce dans Marketplace et payez quelqu’un pour le développer pour vous.
2 « J'aime »