Slider Section set Active Controls

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 24, 2014   (RSS)

Hi guys

am having some issues trying to get the active classes set on a record when it is active in the slider function here is the html code i have and also the output from the cmsb.

I only need to display the <?php echo $record['content']; ?> inside the carousel inner function

  // load records from 'testimonials'
  list($testimonialsRecords, $testimonialsMetaData) = getRecords(array(
    'tableName'   => 'testimonials',
    'perPage'     => '1',
    'orderBy'     => 'RAND()',
    'loadUploads' => false,
    'allowSearch' => false,
  ));

    <?php foreach ($testimonialsRecords as $record): ?>
      Record Number: <?php echo htmlencode($record['num']) ?><br/>
      Class (value): <?php echo $record['class'] ?><br/>
      Class (label): <?php echo $record['class:label'] ?><br/>
      First (value): <?php echo $record['first'] ?><br/>
      First (label): <?php echo $record['first:label'] ?><br/>
      Title: <?php echo htmlencode($record['title']) ?><br/>
      Content: <?php echo $record['content']; ?><br/>
      Youtube: <?php echo htmlencode($record['youtube']) ?><br/>
      Youtube ID: <?php echo htmlencode($record['youtube_id']) ?><br/>
      _link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a><br/>
      <hr/>
    <?php endforeach ?>

                        <div id="home_testimonial" class="carousel slide" data-ride="carousel">
                            <!-- Indicators -->
                            <ol class="carousel-indicators">
                                <li data-target="#home_testimonial" data-slide-to="0" class="active"></li>
                                <li data-target="#home_testimonial" data-slide-to="1"></li>
                                <li data-target="#home_testimonial" data-slide-to="2"></li>
                                <li data-target="#home_testimonial" data-slide-to="3"></li>
                            </ol>
                            
                            <!-- Wrapper for slides -->
                            <div class="carousel-inner">
                                <div class="item active">
                                    <p>"Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum."</p>
                                </div>
                                <div class="item">
                                    <p>"Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui."</p>
                                </div>
                                <div class="item">
                                    <p>"Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum."</p>
                                </div>
                                <div class="item">
                                    <p>"Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui."</p>
                                </div>
                            </div>
                        </div>

Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Hey Craig, I'm not sure what you're asking here, but this is how it should probably work:

<div id="home_testimonial" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<?php foreach ($testimonialsRecords as $idx => $record): ?>
<li data-target="#home_testimonial" data-slide-to="<?php echo $idx; ?>"<?php if($idx == 0) : ?> class="active"<?php endif; ?>></li>
<?php endforeach ?>
</ol>

<!-- Wrapper for slides -->
<div class="carousel-inner">
<?php foreach ($testimonialsRecords as $idx => $record): ?>
<div class="item<?php if($idx == 0) : ?> active<?php endif; ?>">
<p><?php echo $record['content']; ?></p>
</div>
<?php endforeach ?>
</div>
</div>

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/