yea, it would be great if someone could help me on this, i read & search but still couldn’t find the answer this couple of days, maybe i’m still quite noobs in go.
what I want is, to create custom unique id for each div in post loop in the template, because i have a pop-up modal for each post.
what i usually do in php is just declare $i = 1; outside the loop, then in the loop just use
<div id="hidden<?php echo $i++; ?>" >
so it have unique id for each post
i tried with adding variable like this outside the loop
{{ $unique := 1 }}
then in the loop add this
{{ add $unique 1 }}
but the variable just echo 2 and doesnt add up for each post.
am i missing something here? i also try throw the $unique var to new var but still it just echoing same sum.