Mad Otter Games
New member
I am trying to make the reaction summary in a post show the number of each reaction next to their icon. This is the current state of my reactionSummary template:
It appears that {$reactionId|number} just grabs the ID of the reaction type and not the current count - I'm assuming that this template is only passed IDs and not the actual data on the reaction instances. How can I get the amount of that kind of reaction inserted in that spot?
Code:
<xf:macro name="summary" arg-reactionIds="!">
<xf:if contentcheck="true">
<ul class="reactionSummary">
<xf:contentcheck>
<xf:foreach loop="$reactionIds" value="$reactionId"><xf:trim>
<li><span class="reactionCount"> {$reactionId|number}</span><xf:reaction id="{$reactionId}" small="true" /></li>
</xf:trim></xf:foreach>
</xf:contentcheck>
</ul>
</xf:if>
</xf:macro>
<xf:macro name="summary" arg-reactionIds="{$reactionIds}" />
It appears that {$reactionId|number} just grabs the ID of the reaction type and not the current count - I'm assuming that this template is only passed IDs and not the actual data on the reaction instances. How can I get the amount of that kind of reaction inserted in that spot?
Last edited: