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

XF 1.5 Getting user avatar in thread_list_item_simple

Discussion in 'Styling and Customization Questions' started by Dave Thomas, Oct 10, 2015.

  1. Dave Thomas

    Dave Thomas Member

    Apologies if this has been asked before - I've searched and found some minimally helpful stuff, but nothing that actually solves the problem.

    I'm trying to get the recent threads template to show the avatar of the person who has made the latest post in a thread instead of the avatar of the thread's creator. I've seen one suggestion that to do this I should replace the line
    <xen:avatar user="$thread" size="s" img="true" />
    <xen:avatar user="$thread.lastPostInfo" size="s" img="true" />
    however, if I do this, the default avatar appears instead. I've also tried adding avatar_date and other things, to no avail.

    Am I doing something wrong? My current thread_list_item_simple is as follows:
    <xen:require css="thread_list_simple.css" />
    <xen:require css="bb_code.css" />
    <li id="thread-{$thread.thread_id}" class="threadListItem{xen:if $thread.isDeleted, ' deleted'}{xen:if $thread.is_staff, ' staff'}{xen:if $thread.isIgnored, ' ignored'}" data-author="{$thread.username}">
        <xen:avatar user="$thread" size="s" img="true" />
        <div class="messageInfo">
            <div class="messageContent">
                <div class="title">
                    <b><a href="{xen:link "threads{xen:if '{$thread.isNew} AND {$thread.haveReadData}', '/unread'}", $thread}">{xen:helper threadPrefix, $thread, escaped}{$thread.title}</a></b>
            <!-- <div class="additionalRow muted">
                In section <a href="{xen:link forums, $thread.forum}" class="forumLink">{$thread.forum.title}</a>
            </div> -->
            <div class="additionalRow muted">
                {xen:phrase latest}: <b><a{xen:if '{$visitor.user_id}', ' href="{xen:link posts, $thread.lastPostInfo}" title="{xen:phrase go_to_last_message}"'} class="item muted"><xen:datetime time="$thread.lastPostInfo.post_date" /></a></b> by <xen:username user="$thread.lastPostInfo" />

Share This Page