Forum for discussing general topics related to Couch.
14 posts Page 1 of 2
I've been playing around with Repeatable Regions for a new site I am building based on Twitter Bootstrap, and I managed to get the image carousel feature working using them.

In case it may help anyone else, the example code is below.

Regards,

Mark

Code: Select all
<div id="mycarousel" class="carousel">
            <div class="carousel-inner">
             <cms:show_repeatable 'gallery'>
             <cms:if k_count=='1'>
               <div class="item active">
             <cms:else />
               <div class="item">
              </cms:if>
                <img src="<cms:show work_picture/>" alt="">
                <div class="carousel-caption">
                  <h4><cms:show picture_title/></h4>
                  <p><cms:show picture_description/></p>
                </div>
              </div>
            </cms:show_repeatable>           
            </div>
            <a class="left carousel-control" href="#mycarousel" data-slide="prev">&lsaquo;</a>
            <a class="right carousel-control" href="#mycarousel" data-slide="next">&rsaquo;</a>
          </div>


And the code that defines the repeatable regions is:

Code: Select all
 <cms:repeatable name="gallery">
            <cms:editable type="image" name="work_picture" label="Photo" show_preview='1' preview_width='150' input_width='200' col_width='250' />
            <cms:editable type="text" name="picture_title" label="Picture Title"/>
            <cms:editable type="textarea" name="picture_description" label="Picture Description"/>
    </cms:repeatable>
Thank you for sharing the code Mark :)
No problem. I was surprised how simple it was, tbh, and it makes quite an effective gallery.

Obviously I wouldn't use it for 100's of images, but for a "showcase" of half a dozen or so it looks pretty effective, and is very simple for the end-user to add new items.

Regards,

Mark
Fantastic!, exactly what I was looking for. Thank Man...

Would you know how to order the slide/images inside the Couch admin panel?

I would like to be able to post newer pictures to show first, as well as swap the order of images.

many thanks
@olesuper8, rows in repeatable regions support drag-n-drop ordering.
DOH! so they do, I feel like a dumbass, thank you kindly, ((big hugs))
Thank you :) You are welcome.
Hi Everyone,

I'm a new user of the Couch CMS and I must confess it has been a great one for me as this is the first time I will be building a database driven website.

I quite find the repeatable region very interesting and quite easy to deploy. However, I would like to list just one item at a on another page in my website, how can I do that?

For more clarity, I am building a video gallery for my youtube videos, in some cases I would like to add new videos to a particular collection while in the other A playlist will do. So If found out that the repeatable region will be the best method to deploy the gallery items as a page item for one video collection.

However, I want to display just one video item of a collection on my homepage. With the repeatable region It will list all items in the collection. How can I limit the display to one item on the homepage.

Thank you
hi Toheeb, I have a piece of code which deals with repeatable regions and has a count in order to set the class in a different way for the first item in the list. YOu can use this to output just a single item ....

Code: Select all
<cms:set accordion_count='1' />   
          <cms:show_repeatable 'accordion_collapse'>

          <cms:if accordion_count eq '1' >..........</cms:if>

          <cms:incr accordion_count '1' />

</cms:show_repeatable>


That's just one way to skin the cat! You can of course name your count anything you like.
Hi KK,

thanks for the prompt response. I seem not to figure out how to deploy your suggestion. Probably you can help to structure the code if display it in here.

The following are the declaration for the gallery item in the base template head for the gallery

Code: Select all
   <cms:editable name='video_gallery' label='Video Information' type='group' />
   <cms:editable name='video_playlist' label='Video Thumbnail' desc='Enter Video thumbnail here' preview_width='120' preview_height='70'
   show_preview='1' crop='1' group='video_gallery' type='image' />
   
   <cms:repeatable name='videos' label='Video Item' group='video_gallery' >   
      <cms:editable name='video' label='Video' desc='Input Video Playlists embed code here' type='textarea' no_xss_check='1' group='video_gallery' />
      <cms:editable name='video_title' label='Video Title' desc='Enter Video title here' group='video_gallery' type='text' />   
   </cms:repeatable>
      



While the code below shows my deployment on the other page I want the gallery item to be listed as well.

Code: Select all

<cms:pages masterpage='videos.php' limit='1' >      

     <div>
   <cms:show_repeatable 'videos' >                                                  
      <cms:show video />      
     </cms:show_repeatable
     </div>

</cms:pages>



Please kindly assist with the code structuring to achieve the desired output of listing just one video of the repeatable items.

Thanks
14 posts Page 1 of 2