XF 1.5 xen:link syntax

island

Active member
I would like to create a new link in the thread_list_item template which either:
1.) goes to the firt unread post if there is one, or
2.) else, goes to the last post in the thread.

Currently the thread title goes to the first unread post if there is one, or goes to the first post in the thread.
Code:
<a href="{xen:link "threads{xen:if '{$thread.isNew} AND {$thread.haveReadData}', '/unread'}", $thread}" ...

Currently the last post date link goes to the last post in the thread if a visitor is logged in.
Code:
<a{xen:if '{$visitor.user_id}', ' href="{xen:link posts, $thread.lastPostInfo}" title="{xen:phrase go_to_last_message}"'} class="dateTime">

I don't yet understand the xen:link syntax well. Before I brute force it with trial and error, can someone explain the syntax of the first link and how would I create an additional link based on these two, changing the if/else behavior so that if there is no read data, the link goes to the last post in the thread?
 
Top Bottom