XF 2.2 How to implement reactions for $thread.FirstPost?

Orit

Active member
I thought if this works in the post_macros template :<xf:reactions content="{$post}" link="posts/reactions" />
Why shouldn't this work: <xf:reactions content="{$thread.FirstPost}" link="posts/reactions" /> in the thread_list_macros template?

Why does it send multiple server errors?
  • ErrorException: Template error: [E_USER_WARNING] Content for reactions is not an entity src/XF/Template/Templater.php
 
Last edited:
Apparently it happens when $thread.FirstPost.reactions is an empty array.
So wrapping the div with the following condition could help:
<xf:if is="!empty($thread.FirstPost.reactions)">
I'll post an update if I am wrong :D
 
Back
Top Bottom