• 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.

#1
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:
Code:
<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
#2
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.
 
#5
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:
Code:
<!-- h1 title, description -->
                            <div class="titleBar">
                                {xen:raw $beforeH1}
                                <h1><xen:if
                                    is="{$h1}">{xen:raw $h1}<xen:elseif
                                    is="{$title}" />{xen:raw $title}<xen:else
                                    />{$xenOptions.boardTitle}</xen:if></h1>
                               
                                <xen:if is="{$pageDescription.content}"><p id="pageDescription" class="muted {$pageDescription.class}">{xen:raw $pageDescription.content}</p></xen:if>
                            </div>
 

Jake Bunce

XenForo moderator
Staff member
#6
Oh I understand now.

Admin CP -> Appearance -> Templates -> thread_view

Add this to the top:

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