Adding a closing DIV to existing Content block

Permalink
So I'm using the Content block to add text to a slider. The markup is:

<div class="cs_slider">
            <div class="cs_article">
                <p>Lorem ipsum sit dolor amet etc...</p>
            </div><!-- End cs_article -->
            <div class="cs_article">
                <p>Another testimonial..</p>
            </div><!-- End cs_article -->
</div>


I added this to the page:

<div class="cs_slider testimonials">
                <?php
      echo '<div class="cs_article">';
      $a = new Area('testimonial');
      $a->display($c);
      ?>
</div><!-- End cs_slider -->


I've tried various ways to add the closing div, but it doesn't show except outside of all of the added P tags. This is how it displays:

<div class="cs_slider testimonials">
                <div class="cs_article"><p>Lorem ipsum sit dolor amet etc...</p><p>Another testimonial...</p>
        </div><!-- End cs_slider -->


Any thoughts?

stephmars
 
hereNT replied on at Permalink Best Answer Reply
hereNT
I'd use block wrapper start and end:

$a = new Area("Testimonials"); 
$a->setBlockWrapperStart('<div class="cs_article">');
$a->setBlockWrapperEnd('</div>');
$a->display($c);


This will put the html around any block you add to this area in non-edit mode. In edit mode the area is output as normal. You'll need to adjust your template and slider to not function in edit mode, but after you make that adjustment the text can be either content blocks or image blocks or videos or whatever else your slider supports.

It hasn't worked for every slider I've tried but I have done several like this and it's worked well.
stephmars replied on at Permalink Reply
stephmars
Thank you so much. This worked perfectly.