Persona: display full name instead of username



  • Hi,

    is there a way to display the full name instead of the username in posts? Thank you

    Chris



  • Found it :)

    https://github.com/NodeBB/nodebb-theme-persona/blob/master/templates/partials/topic/post.tpl#L16

    change that line to...

    <a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->" itemprop="author" data-username="{posts.user.username}" data-uid="{posts.user.uid}">{posts.user.fullname}</a>
    

    Full Name is an optional field so not everybody updates it in their profile. You might want to check if it's available before displaying it.

    <a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->" itemprop="author" data-username="{posts.user.username}" data-uid="{posts.user.uid}"><!-- IF posts.user.fullname -->{posts.user.fullname}<!-- ELSE -->{posts.user.username}<!-- ENDIF posts.user.fullname --></a>
    

Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.