Text Box Line Items

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 20, 2015   (RSS)

By Mohaukla - January 19, 2015

I have a text box in a section that is setup for having each line item appear as a span item in the code below

<h1 class="short word-rotator-title">
TEBBEN is a quality manufacturer of <strong class="inverted">
<span class="word-rotate" data-plugin-options='{"delay": 2000, "animDelay": 300}'>
<span class="word-rotate-items">
  <span>Quality Farm Equipment</span>
  <span>Industrial Equipment</span>
  <span>Boat Trailers</span>
</span>
</span>
</strong>
</h1>

<h1 class="short word-rotator-title">
TEBBEN is a quality manufacturer of <strong class="inverted">
<span class="word-rotate" data-plugin-options='{"delay": 2000, "animDelay": 300}'>
<span class="word-rotate-items">
   <?php foreach ($homepageRecord as $record): ?>
   <span><?php echo htmlencode($homepageRecord['rotating_upper_words']) ?></span> // This need to be fixed to echo each line item in the text box
   <?php endforeach ?>
</span>
</span>
</strong>
</h1>

Please advise

Michael

Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"

By claire - January 20, 2015

Try changing your code to this:

<h1 class="short word-rotator-title">
TEBBEN is a quality manufacturer of <strong class="inverted">
<span class="word-rotate" data-plugin-options='{"delay": 2000, "animDelay": 300}'>
<span class="word-rotate-items">
   <?php foreach ($homepageRecord as $record): ?>
   <?php $lines = explode("\n", $homepageRecord['rotating_upper_words']); ?>
   <?php foreach ($lines as $line) : ?>
     <?php if($line != ''): ?>
       <span><?php echo $line; ?></span>
     <?php endif; ?>
   <?php endforeach; ?>
   <?php endforeach ?>
</span>
</span>
</strong>
</h1>

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

Claire Ryan
interactivetools.com

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