Change Default Avatar in home page (for original author avatar)

If you’re referring to the “latest” list on the categories page, then this is what you need to change:

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs#L2-L4

If you want the avatar of the topic creator, you need to pass that instead, so you go from

{{#user-link user=topic.lastPoster}}
  {{avatar topic.lastPoster imageSize="large"}}
{{/user-link}}

to

{{#user-link user=topic.creator}}
  {{avatar topic.creator imageSize="large"}}
{{/user-link}}

So something like this in the header section of your theme

<script type="text/x-handlebars" data-template-name="components/latest-topic-list-item">
<div class='topic-poster'>
 {{#user-link user=topic.creator}}
  {{avatar topic.creator imageSize="large"}}
 {{/user-link}}
</div>
<div class='main-link'>
 <div class='top-row'>
  {{raw "topic-status" topic=topic}}
  {{topic-link topic}}
  {{#if topic.featured_link}}
   {{topic-featured-link topic}}
  {{/if}}
  {{topic-post-badges newPosts=topic.totalUnread unseen=topic.unseen url=topic.lastUnreadUrl}}
 </div>
 <div class='bottom-row'>
  {{category-link topic.category}}
  {{discourse-tags topic mode="list"}}
 </div>
</div>
<div class='topic-stats'>
 {{raw "list/posts-count-column" topic=topic tagName="div"}}
 <div class="topic-last-activity">
  <a href="{{topic.lastPostUrl}}" title="{{topic.bumpedAtTitle}}">{{format-date topic.bumpedAt format="tiny" noTitle="true"}}</a>
 </div>
</div>
</script>

there’s more on template overrides here

7 Likes