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

Last post username link

Discussion in 'XenForo Development Discussions' started by AndyB, Oct 24, 2014.

  1. AndyB

    AndyB Well-Known Member


    I'm updating my Similar Threads add-on and need some help in figuring out how to create a link to the last post username.

    Here's screen print of what I currently have, the last post username is currently just text.


    The code that XenForo uses for this type of template looks like this, but I would like to avoid using $thread.lastPostInfo if possible.

    <dt><xen:if is="{xen:helper isIgnored, $thread.last_post_user_id}">{xen:phrase ignored_member}<xen:else /><xen:username user="$thread.lastPostInfo" /></xen:if></dt>
    I currently have this in my template.

    What I would like to have is this, but when I try to save the template it comes back as an error and won't allow me to save it:

    <dt><a href="{xen:link 'members', '', '/{$thread.last_post_user_id}/'}">{$thread.last_post_username}</a></dt>
    Thank you for your help.
    Last edited: Oct 24, 2014
  2. Chris D

    Chris D XenForo Developer Staff Member

    That's the proper way of doing it. Don't avoid it.

    The solution you'd like to work is ghastly.
    Jeremy likes this.

Share This Page