XF 2.2 Help with hiding reactions from 1st post only in Suggestion type

beerForo

Well-known member
Would anyone be able to assist with code/conditional that hides the reaction icons and ability to react from the 1st post in a Suggestion forum?
The use case is, I am changing the up/down arrows to thumbs up/down (only in Suggestion type, not Q&A) and since the "Like" button is a thumbs up I would like to avoid confusion as well as focus on the voting only. Thanks if you can assist! I appreciate it!
 
Edit the post_macros template and change line 263 from this:
HTML:
<xf:react content="{$post}" link="posts/react" list="< .js-post | .js-reactionsList" />

To this:
HTML:
<xf:if is="$thread.discussion_type == 'suggestion' AND $thread.first_post_id == $post.post_id"><xf:else />
    <xf:react content="{$post}" link="posts/react" list="< .js-post | .js-reactionsList" />
</xf:if>

That won't stop people from manually crafting a URL to react to a post though, for example - https://xenforo.com/community/posts/1483337/react?reaction_id=1 - it just doesn't show the like option on the post.
 
Back
Top Bottom