Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hi guys,

I am creating a website using Foundation 5 and want to utilise the push and pull classes. To do this, I need to add certain classes to a column if it is in a row of an 'even' number i.e. row 2, 4 and 6. Here is my code:
Code: Select all
<cms:capture into='commercial_sponsors'>
   <section class="content">
      <div class="row">
         <div class="columns medium-12 small-12">
            <h1>Home of...</h1>
         </div>
      </div>

      <cms:show_repeatable 'businesses'>
         <div class="row" data-equalizer>
            <div class="columns medium-4 small-12" data-equalizer-watch>
               <a href="<cms:show link />" title="Visit <cms:show title />" target="_blank">
                  <cms:if "<cms:not_empty image />">
                     <div class="valignout">
                        <div class="valignin">
                           <img src="<cms:thumbnail image width='340' />" alt="<cms:show caption />" />
                           <cms:set has_image='1' 'global' />
                        </div>
                     </div>
                  </cms:if>
               </a>
            </div>

            <div class="columns medium-8 small-12" data-equalizer-watch>
               <h3><cms:show title /></h3>
               <cms:show description />
            </div>
         </div>
      </cms:show_repeatable>
   </section>
</cms:capture>

<cms:if has_image>
   <cms:show commercial_sponsors />
</cms:if>
Would I do this using the zebra or the k_count functionality? Does anyone have an example I could look at?
- Dan
Hi,

The <cms:zebra> (https://docs.couchcms.com/tags-reference/zebra.html) tag should suffice for your requirement.
Following is an example that outputs a blank for the first row and 'even' for the second row and continues repeating this pattern for all rows that follow -
Code: Select all
<cms:show_repeatable 'businesses'>
    <div class="<cms:zebra '' 'even' />">
        ..
    </div>
</cms:show_repeatable> 

Hope this helps.
2 posts Page 1 of 1
cron