I have this code
{exp:channel:entries channel="katalog" limit="12" dynamic="yes" status="open" show_future_entries="no" orderby="date" sort="desc" disable="member_data" pagination="bottom"} {!-- if entry has one of those three categories then set variable link to true --} {categories show="51|50|39"} {exp:stash:set_value name="link" value="true"} {/categories} {if "{exp:stash:get name='link'}" == "true"} //then print content1 {if:else} //print content2 {/if} {!-- delete stash variable and go for next loop because channel entries will do this 12 times --} {exp:stash:unset name="link"} {/exp:channel:entries}
what happens is this. If first entry in pagination has some category, then stash variable will be set to true for all 12 entries shown on that pagination page. Likewise, if first entry does not have any category added to itself then variable link will not be set to "true" and other part of if condition will be displayed.
How to make stash to overwrite it's values ... what am I doing wrong? I need categories for this problem, but I am not sure what else to use.