Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
In the Portfolio chapter of the tutorial, specifically the section on Page-View, the example shows a group of three images, thus requiring to declare three inputs for those three images in a group.

But, what if I want less/more images? How do I loop it so I can choose in the couch dashboard to add more images?
You could use repeatable regions (http://www.couchcms.com/docs/concepts/r ... gions.html) to make an unlimited amount of photos possible.
Hi Saskia, thanks, this is going the right way. But, what if my images will be part of a slideshow (most likely powered by javascript), with html markup.

Example:

Code: Select all
   <section id="project1">
       <div class="row">
           <div class="columns">
                <div class="slideshow" align="center">
                    <div><img src="pic.jpg"><h2>name title</h2></div>
<div><img src="pic.jpg"><h2>name title</h2></div>
<div><img src="pic.jpg"><h2>name title</h2></div>
<div><img src="pic.jpg"><h2>name title</h2></div>
                </div>
   </div>
        </div>
    </section>


Then I need to make <div class="slideshow" ... /div> repeatable, so the images I add in the dashboard all go into this slideshow.

What code do I need for that?
Take a look at the documentation for using repeatable regions. It's pretty easy.
http://www.couchcms.com/docs/concepts/r ... gions.html

This topic goes into some detail about making a slideshow from a repeatable region or using a clonable template.
viewtopic.php?f=4&t=8166
The code you want goes something like this:
Inside the template tag you put your repeatable region.
Code: Select all
<cms:repeatable name="slideshow" label='slideshow' >
   <cms:editable name='slideshow_image'
      ...
      ...parameters go here...
      ...
      type="image" />
   <cms:editable name='image_title' type="text" />
</cms:repeatable>

Front end loops through the repeatable items like this.
Code: Select all
<section id="project1">
       <div class="row">
           <div class="columns">
                <div class="slideshow" align="center">
                   <cms:show_repeatable 'slideshow'>
                        <div><img src="cms:show slideshow_image />"><h2><cms:show image_title /></h2></div>
                    </cms:show_repeatable>
                </div>
         </div>
        </div>
</section>

Does that work?
Thanks Tim. Didn't expect it was that easy :o :oops:

Are there differences/advantages between putting the <cms:repeatable> at the top and inline at specific sections? Or is it just more clear having it all at the top, especially if you have a bunch of those? Does piling it at the top not effect load-time of some sort? (similar to loading unneccessary js scripts in the header instead of the footer)
Or is it just more clear having it all at the top, especially if you have a bunch of those?
That is the main reason. For complex templates, it is always more manageable to have all the regions defined at one spot.

There is no performance overhead with this method.
Thanks KK. Understood.
8 posts Page 1 of 1