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.
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.
-
discourse/topic-list-header.hbr at main · discourse/discourse · GitHub
topic-list-header
to modify the header section. -
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
Actually I made a theme component to present it easier. You can use it if you want.
You can select from two columns with settings.
By default it show the last post but you can change it to show authors.
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
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.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.