list results in rotating view

13 posts by 2 authors in: Forums > CMS Builder
Last Post: September 26, 2013   (RSS)

By Jason - September 26, 2013


This is still an issue with the divs.  What it looks like is that we need to move the clearfix div outside of the foreach loop so that it wraps around each group of 2.  Try this:

  $eventsPerSlide = 2;   
  $eventCount     = 0;
<div class="text-slider">
  <ul class="slides">
      <div class="clearfix">
      <?php foreach ($eventsRecords as $record): ?>
          <div class="one-half">
            <div class="event-preview">
              <div class="event-date-wrapper">
                <div class="event-month"><?php echo $record['month'] ?></div>
                <div class="event-day"><?php echo $record['day'] ?></div>
              <div class="event-entry-inner">
                <h4><a href="<?php echo $record['_link'] ?>"><?php echo htmlencode($record['title']) ?></a> <span>Event Time: <i><?php echo htmlencode($record['event_time']) ?></i> / Event Location: <i><?php echo htmlencode($record['event_location']) ?></i></span></h4>
                <p><?php echo htmlencode($record['brief_event_summary']) ?></p>
          <?php if (++$eventCount % $eventsPerSlide == 0): ?>
            <div class = "clearfix">
          <?php endif ?>
      <?php endforeach ?>

Hope this helps

Jason Sauchuk - Project Manager

Hire me! Save time by getting our experts to help with your project.

Hi Jason

No, that doesn't fix it either. See

I think perhaps I'll have to ditch this option as the listing doesn't appear to work with style (such a shame!)