How to display FullName on Topics in Fakebook theme

AI-generated summary

The discussion revolves around displaying the full name instead of the username on topics in the Fakebook theme’s /latest page. Pandiyan reports that despite disabling ‘prioritize username in ux’ and enabling ‘display name on posts’, only the username appears. JammyDodger requests clarification, while Don explains that the Fakebook theme uses a custom template for topic lists, which can be modified to show the full name. Don provides a specific code modification to the custom-topic-list-item.hbr template file, adding {{topic.posters.[0].user.name}} to display the full name above the username, and shares a forked example demonstrating the change. Pandiyan thanks the contributors and asks if there’s a simpler way to achieve this without modifying the theme code.

Can someone tell me how to display FullName on topics specifically in ‘…/latest’ page.

  1. I have disabled ’ prioritize username in ux ’ site settings.
  2. I have enabled ’ display name on posts ’ site settings.

Even after doing this, I am able to see only the userName on topic instead of fullName. Can someone help me.

Did you reload the page after changing the settings?

Yes I did @pfaffman , Actually I am facing this issue for long days. Do I need to change anything in site settings ? Could you please tell me if anything is there other than the above two options. Currently it looks like below. displaying only userName.

Hi @Pandiyan :slight_smile:

I’m not sure I’m following what you mean by this. Where are usernames displayed on the /latest page? Could you give a bigger screenshot of the page you wish the usernames to be swopped out for fullnames so I can get a better idea of what you’re trying to acheive?

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. https://github.com/discourse/Fakebook/blob/main/javascripts/discourse/templates/list/custom-topic-list-item.hbr

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

Hope this helps :slightly_smiling_face:

Thanks @JammyDodger for asking more details of my issue. And Thank you so much @Don Great! . Exactly it is a FakeBook theme we are using. I will try to follow the steps to achieve.

And I would also like to know, is there any other possibility of adding some set of codes in my component header/any other section/or in CSS ?, so that it will be very simplest way right. Let me know if anything is there. Thank You!