Author name plus avatar

Hey all - our community has a desire to see post author’s name in addition to their avatar. Any tips on emulating this display, as seen on Sam’s Simple Theme.

1 Like

Hello Mike,

Sam’s Simple Theme is overriding the topic-list template and only shows the latest posters not the authors. Here a really cool guide how to override template.

There are 2 templates in core what we should override for this.

  1. discourse/topic-list-header.hbr at main · discourse/discourse · GitHub
    topic-list-header to modify the header section.

  2. discourse/topic-list-item.hbr at main · discourse/discourse · GitHub
    topic-list-item to modify the avatar and add username.


You can find all templates in here: discourse/app/assets/javascripts/discourse/app/templates at main · discourse/discourse · GitHub

Let’s start :arrow_down_small:

Actually I made a theme component to present it easier. You can use it if you want. :slightly_smiling_face:

You can select from two columns with settings.
By default it show the last post but you can change it to show authors.
Screenshot 2022-08-16 at 17.00.54

Topic list header
Firstly we have to modify the column header.

I added these lines and removes posters and views and activity column header.

This is add the header Last Post or Author
Last Post


Author

I’ve also added a locale file to translate these…
You can translate here :arrow_down_small:
Screenshot 2022-08-16 at 17.05.07


Topic list item

I removed the posters column and add the Last Post or Author column.

Last Post Column

Authors Column with (topic creation) time.


Finally add some CSS.


Hope it helps! You can compare with the core templates or if you use any custom templates and change or use the component if it fits your needs. :slightly_smiling_face:

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.