Hi we are using the underscore.js library for some of our code:
{{ _.each(items, function(item) { }}
<li class="">
<a class="title" href="{{= item.Id }}"><h2>{{= item.Name}}</h2></a>
<p>{{= item.ShortDesc}}</p>
</li>
{{ }); }}
Which will output:
<li><a><h2>Element 1</h2></a><p>Description of element 1</p></li>
<li><a><h2>Element 2</h2></a><p>Description of element 2</p></li>
...
But what we want is:
<li>
<a><h2>Element 1</h2></a><p>Description of element 1</p>
<a><h2>Element 2</h2></a><p>Description of element 2</p>
</li>
<li>
<a><h2>Element 3</h2></a><p>Description of element 3</p>
<a><h2>Element 4</h2></a><p>Description of element 4</p>
</li>
...
Basically, fill the <li>
every 2 items using the _.each
.
Please advise. Thanks