Add column to home page topic list

AI-generated summary

The discussion is about adding a column with author topic avatars to the home page topic list. Varhall shared their design and current page screenshots, but the images didn’t display properly. Canapin pointed out the issue, and Varhall apologized and suggested uploading the images to the topic.

Varhall asked if there’s an easy way to achieve this with a script, sharing an example code snippet. Sam replied that there’s no easy way to amend a template and provided an example of a custom topic list design.

Varhall asked for the location of the Discourse template file responsible for displaying topics to create a theme. Later, Varhall asked if they need to override a specific template file and provided the code for adding a column with author avatars.

Ultimately, Varhall created a theme, available on GitHub, which adds the desired column with author topic avatars to the home page topic list.

Hi all!

I need add colum with author topic avatar to home page topic list.

I have a design:

This page now:

Help me please! Thank you!

Your links don’t work:

Sorry, upload images to topic

maybe there is an easy way to do this with a similar script?

<script>
var TopicListComponent = require('discourse/components/topic-list').default;
TopicListComponent.reopen({
    showLikes: true
});
</script>

There is no easy way to amend a template, you have to completely rewrite it to move stuff around if a CSS hack is not enough, you can see an example here:

Thank you Sam! Where is the discourse template file that is responsible for displaying topics? I’ll try to create a theme.

Do I need to override this template?

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/list/topic-list-item.hbr

In override file add column with author avatar:

<td class='poster-author'>
<a href="{{poster.user.path}}" data-user-card="{{poster.user.username}}" class="{{poster.extraClasses}}">{{avatar poster avatarTemplatePath="user.avatar_template" usernamePath="user.username" namePath="user.name" imageSize="small"}}</a>

I think correctly?

Sorry for more questions) I worked with php only

Created theme GitHub - Varhal/Discourse-author-column: Discourse · GitHub