How to limit the number of webapp result to one based on a condition
i'm working on webapp. want display "only one" result based on if condition met. code:
{module_webapps id="29947" render="item" filter="all" hideemptymessage="true" rowcount="1" collection="latestmonthlywinner" sorttype="date" template=""}
{% item in latestmonthlywinner.items -%}
{% if item.typewinner == "monthly" -%}
<div class="w-row contents2-row">
<div class="w-col w-col-7 w-col-stack contents2-col">
<div class="content-textblock-1 t2new"> {{item.releasedate | date: 'mmmm' }} {{item.itemid}}</div>
<a href="promotions-starwinner.html" title="see star winner's testimonial" class="w-button content-btnlink">view star winner's page</a>
</div>
<div class="w-col w-col-5 w-col-stack contents2-col right" style=" background-image: url({{item.monthwinnerpic}}); background-position: 50% 50%; background-size: cover;height: 100%;padding: 9% 2%;background-position: 50% 50%;"></div>
</div>
{% endif -%}
{% endfor -%}
please can point me doing wrongly. results keep getting displays results. want display 1 out of results. appreciated if can help.
all loop doing finding have month in condition.
if want stop when finds first 1 need use loop break method:
logic tags | business catalyst support {% break %}
this should go before endif.
More discussions in Developer forum
adobe
Comments
Post a Comment