What's new
  • Do not create multi-accounts, you will be blocked! For more information about rules, limits, and more, visit the Help Page Found a dead link? Use the report button!
  • If no files are available, please contact me or reply in the thread. I will update them immediately.

Xenforo Tutorial Add avatar in titles in Xenforo

Codes MagicCodes Magic is verified member.

Administrator
Administrator
Moderator
Compatible XF Versions
XF 2.0,
Screenshot_20250305-201858.webp
Here’s a modification I tested on XF 2.1. On XF 2.0, I use the add-on [XenGenTr] XenTitleAvatar, but it doesn’t work on XF 2.1.


In your thread_view template, search for:
HTML:
<li>
            <xf:fa icon="fa-clock" title="{{ phrase('start_date')|for_attr }}" />
            <span class="u-srOnly">{{ phrase('start_date') }}</span>

            <a href="{{ link('threads', $thread) }}" class="u-concealed"><xf:date time="{$thread.post_date}" /></a>
        </li>

add this code

HTML:
<div class="XenKonuAvatarBG">
            <xf:avatar user="$thread.User" size="s" defaultname="{$fallbackName}" itemprop="image" />
            </div>

In your extra.less add:

CSS:
.XenKonuAvatarBG {
    float: left;
    margin-right: 8px;
    margin-top: -33px;
}
.p-title-value { margin-left: 5%; }
 
Back
Top