Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
I have just created a new page that has testimonials on it and it uses flickity carousel and at the moment , it has three testimonials on it, I was just seeing if there is a way the website owner could add more himself without me adding more coding if he wants more than 3 to show on there, the coding I currently have is below

Code: Select all
<div class="main-gallery">
  <div class="gallery-cell">
    <div class="testimonial">
      <q class="testimonial-quote">
          <cms:editable name='testimonials_one_content' toolbar='full' type='richtext'>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mauris ex, gravida ut leo eu, rhoncus porta orci. Fusce vitae rutrum nulla.
        </q>
          </cms:editable>
      <span class="testimonial-author">Name</span>
    </div>
  </div>
  <div class="gallery-cell">
     <div class="testimonial">
      <q class="testimonial-quote">
          <cms:editable name='testimonials_two_content' toolbar='full' type='richtext'>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mauris ex, gravida ut leo eu, rhoncus porta orci. Fusce vitae rutrum nulla.
         </q>
          </cms:editable>
      <span class="testimonial-author">Name</span>
    </div>
  </div>
  <div class="gallery-cell">
        <div class="testimonial">
      <q class="testimonial-quote">
          <cms:editable name='testimonials_three_content' toolbar='full' type='richtext'>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mauris ex, gravida ut leo eu, rhoncus porta orci. Fusce vitae rutrum nulla.
            </q>
          </cms:editable>
      <span class="testimonial-author">Name</span>
    </div>
  </div>
</div>

<script>
    var flkty = new Flickity( '.main-gallery', {
  cellAlign: 'left',
  contain: true,
  wrapAround: true,
  prevNextButtons: false,
  pageDots: false,
  autoPlay: 5000
});
</script>
Please try using 'repeatable regions; (https://docs.couchcms.com/concepts/repe ... gions.html
Search and you'll find several threads discussing implementation of sliders using repeatable regions.
I have had a go and got the repeatable regions working and can add the rows from the admin side but on the front end, the text for both repeatable regions shows in the one slide, it should have just one testimonial per slide

the updated coding is below

Code: Select all
<cms:template title='Testimonials Page' order='1' />

<cms:repeatable name='testimonials_newadd' >
    <cms:editable type='richtext' toolbar='full' label='Testimonial' name='testimonials_page_content' />
</cms:repeatable>

<div class="main-gallery">
  <div class="gallery-cell">
    <div class="testimonial">
      <q class="testimonial-quote">
             
<cms:show_repeatable 'testimonials_newadd' >
    <cms:show testimonials_page_content />
</cms:show_repeatable>
             
        </q>
    </div>
  </div>
</div>


I have attached a screenshot

Attachments

As usual, if something is not right - do a view-source in browser with generated HTML and compare it to your static HTML. You will see the differences. Adapt your code to make both variants equal. Use and study the ton of samples from the forum, as @KK pointed out.
After some moving of the moving around of the cms tags, I got it working with the updated coding below

Code: Select all
<div class="main-gallery">
    <cms:show_repeatable 'testimonials_newadd' >
  <div class="gallery-cell">
    <div class="testimonial">
      <q class="testimonial-quote">
    <cms:show testimonials_page_content />
    </q>
        <span class="testimonial-author">
            <cms:show testimonials_name_content />
            </span>
    </div>
  </div>
        </cms:show_repeatable>
</div>
5 posts Page 1 of 1
cron