How to display FullName on Topics in Fakebook theme

Hello,

It looks like this is the Fakebook, a theme for social media lovers theme. Fakebook theme uses custom template on topic list to show username but you can modify this template to show the full name too. :slightly_smiling_face:

For this you need to fork the theme on Github and edit the template file. This is the file you have to modify on your fork. Fakebook/custom-topic-list-item.hbr at main · discourse/Fakebook · GitHub

This template has a section which handle user datas on topic list. You have to edit this.

This line shows the username. :arrow_down_small:

<span class="username">{{topic.posters.[0].user.username}}</span>

So we have to add the full name before or after this.


To add full name just simple change this section something like this :arrow_down_small:

<div class="name-and-date">
  <span class="full-name-topic-list">{{topic.posters.[0].user.name}}</span>
  <span class="username">{{topic.posters.[0].user.username}}</span>
    {{format-date topic.createdAt format="tiny"}}
</div>

I added this line above username and this will show the full name on topic list, above username.

<span class="full-name-topic-list">{{topic.posters.[0].user.name}}</span>

Probably need some CSS change but you can easily target the full-name-topic-list class or whatever class you added.


I forked the Fakebook theme now and made this change in this commit so you can see it. Add full name to topic list · VaperinaDEV/Fakebook@0978133 · GitHub

And this is how it looks like.

Don - Full Name
dodesz - Username

Screenshot 2022-08-09 at 16.19.54

Hope this helps :slightly_smiling_face:

2 Likes