Last post username link

AndyB

Well-known member
Hello,

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.

pic001.webp

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

Code:
<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.

Code:
<dt>{$thread.last_post_username}</dt>

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:

Code:
<dt><a href="{xen:link 'members', '', '/{$thread.last_post_user_id}/'}">{$thread.last_post_username}</a></dt>

Thank you for your help.
 
Last edited:
The code that XenForo uses for this type of template looks like this, but I would like to avoid using $thread.lastPostInfo if possible.
That's the proper way of doing it. Don't avoid it.

The solution you'd like to work is ghastly.
 
Top Bottom