by
tim » Tue May 20, 2014 1:49 am
Hi derKaiser. Let me see if I can help.
Normally a slider is made up of 2 parts.
1. There is some html code that holds your image, caption, text, whatever else. This code is repeated for the number of items you have in your slider.
2. Some javascript code that animates the slider.
It doesn't really matter exactly how your code works. Couch can be plugged in anywhere. For our purposes we can forget about the javascript and focus on the html.
Let's say you have the following structure in your html:
- Code: Select all
<p>Text for the first slide.</p>
<img src="path/to/picture1.jpg" />
<p>Caption for Picture 1</p>
<p>Text for the second slide.</p>
<img src="path/to/picture2.jpg" />
<p>Caption for Picture 2</p>
<p>Text for the third slide.</p>
<img src="path/to/picture3.jpg" />
<p>Caption for Picture 3</p>
You might have 3 or 5 or any number of slides. That's why we want to use a repeatable region. So in your template, you will create a repeatable region with 3 items: image, text, and caption.
- Code: Select all
<cms:repeatable name="slider" label='slider' >
<cms:editable name='slider_image'
label="Slideshow Image"
width="640"
height="430"
show_preview='1'
preview_width="150"
type="image" />
<cms:editable name='slider_text'
label="Text"
type="text" />
<cms:editable name='slider_caption'
label="Caption"
type="text" />
</cms:repeatable>
On the front end you replace the hard coded information with Couch tags.
- Code: Select all
<cms:show_repeatable 'slider' >
<p><cms:show slider_text /></p>
<img src="<cms:show slider_image />" />
<p><cms:show slider_caption /></p>
</cms:show_repeatable>
Now Couch will cycle through all of the slides you enter into your admin panel and output them into your slider. It doesn't matter what your actual code is. You just place the cms:show tags wherever you need the items to appear on the front end. It really is very straightforward. Be patient. Use the documentation. Take some time to learn and gain experience. You'll find that Couch is very easy to adapt to your own needs as you learn how to use it.
Good luck and let us know if that helps.