Trying to add two products into a cycle group row

New Member
1 0 0

Struggling to get this to work. I want two products with different classes to show in odd and even rows.

 

Heres what im trying to achieve: 

 

<div class="row odd">

        <div class="product-tile-1"> (1st product in collection)</div>

        <div class="product-tile-2">(2nd product in collection)</div>

</div>

<div class="row even">

      <div class="product-tile-1">(3rd product in collection)</div>

      <div class="product-tile-2">(4th product in collection)</div>

</div> 

 

... etc

 

Right now the odd/even rows are outputting correctly but I is only outputting one product per row with the class tile-1 in odd and the class tile-2 in even.

 

Heres the code 

 {% cycle 'section-group-start': '<div class="row-odd">','<div class="row-even">' %}
 {% cycle 'section-group-2-start': '<div class="product-tile-1">','<div class="product-tile-2">' %}
       <a href="{{ product.url }}">
	  <div class="product-info">
		<div class="product-name">
		   <h2>{{ product.title }}</h2>
		</div>
		<div class="price">
		   <h3>{{ product.price | money }}</h3>
		</div>
	  </div>
		<div class="product-image" style="background-image:url('{{ product.images.last | product_img_url: 'master' }}');">		
		    <img src="{{ product.images.first | product_img_url: 'master' }}" alt="{{ featured.featured_image.alt | escape }}">
		</div>  
	 </a>
	   {% cycle 'section-group-2-end': '</div>', '</div>' %}
	   {% cycle 'section-group-end': '</div>', '</div>' %}
	{% endfor %}

 

0 Likes