• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Getting the post's author's avatar.

Im trying to put the avatar of the author of a post beside the title, and i would like to know how could i make it work.

i tried to use this line:
<xen:avatar user="$user" size="m" img="true" />
but the variable "$user" doesn't hold any user... i would like to have some help with it :)

Jake Bunce

XenForo moderator
Staff member
Where exactly? I need to know what page and where so I can check if there is enough information available to display an avatar. If not then an addon will be required.
No, its a clean installation.
My intention is to put the avatar beside the title within a thread, no in the thread list.
The specific part in template:
<!-- h1 title, description -->
                            <div class="titleBar">
                                {xen:raw $beforeH1}
                                    is="{$h1}">{xen:raw $h1}<xen:elseif
                                    is="{$title}" />{xen:raw $title}<xen:else
                                <xen:if is="{$pageDescription.content}"><p id="pageDescription" class="muted {$pageDescription.class}">{xen:raw $pageDescription.content}</p></xen:if>

Jake Bunce

XenForo moderator
Staff member
Oh I understand now.

Admin CP -> Appearance -> Templates -> thread_view

Add this to the top:

<xen:container var="$beforeH1">
	<xen:avatar user="$thread" size="m" img="true" />
That will pass the author's avatar to the container var, $beforeH1.