AndyB
Well-known member
In my Similar Threads add-on, I display similar results like this:
The add-on works great when displaying a thread because I can use the $forum variable with the xen:link.
(this works fine)
However when creating a thread, the $forum variable is out of scope.
(this doesn't work)
I get a forum link that shows the thread title in the URL.
The add-on works great when displaying a thread because I can use the $forum variable with the xen:link.
(this works fine)
Code:
<xen:foreach loop="$similarThreads" key="$index" value="$similarThread">
<tr class="dataRow">
<td><a href="{xen:link forums, $forum}" title="{$similarThread.nodetitle}">{$similarThread.nodetitle}</a></td>
<td><a href="{xen:link threads, $similarThread}" title="{$similarThread.title}">{$similarThread.title}</a></td>
<td>{xen:datetime $similarThread.post_date}</td>
</tr>
</xen:foreach>
However when creating a thread, the $forum variable is out of scope.
(this doesn't work)
Code:
<xen:foreach loop="$similarThreads" key="$index" value="$similarThread">
<tr class="dataRow">
<td><a href="{xen:link forums, $similarThread}" title="{$similarThread.nodetitle}" target="_blank">{$similarThread.nodetitle}</a></td>
<td><a href="{xen:link threads, $similarThread}" title="{$similarThread.title}" target="_blank">{$similarThread.title}</a></td>
<td>{xen:datetime $similarThread.post_date}</td>
</tr>
</xen:foreach>
I get a forum link that shows the thread title in the URL.
Last edited: