Add column to 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:

3 Likes

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 https://github.com/Varhal/Discourse-author-column

5 Likes

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