Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hello! I trying to use Repeatable Regions. And it's working great, but I wonder how I can use exempel. list.php, there i want all repeatable come inside there with an image and this is working.

But while i have add a new row, I want them too been seen inside index.php too with an limit of 10 list.

Should I use embed too show it inside the index.php site?
Hi Xtriz3D,

Let us suppose a repeatable region named 'my_images' is defined in a template named 'example.php'.

If we want to display this repeatable-region on another template, say index.php, we can place the following in index.php -
Code: Select all
<cms:pages masterpage='example.php' page_name='xyz' >
   <cms:show_repeatable 'my_images' >
      ...
   </cms:show_repeatable>
</cms:pages>

In the code above we are showing the repeatable region from a cloned page named 'xyz' of example.php. If example.php happens to be a non-cloned template, simply drop the 'page_name' parameter e.g.
Code: Select all
<cms:pages masterpage='example.php' >
   <cms:show_repeatable 'my_images' >
      ...
   </cms:show_repeatable>
</cms:pages>

Replying to your other query- there is no 'limit' parameter so to show only a limited number of rows we'll have to do the counting ourselves using the k_count variable e.g. as follows -
Code: Select all
<cms:pages masterpage='example.php' >
    <cms:show_repeatable 'my_images' startcount='0' >
        <cms:if k_count lt '10'>
        ...
        </cms:if>
    </cms:show_repeatable>
</cms:pages>

Hope it helps.
Wow Thanks that working.
KK wrote: Hi Xtriz3D,

Let us suppose a repeatable region named 'my_images' is defined in a template named 'example.php'.

If we want to display this repeatable-region on another template, say index.php, we can place the following in index.php -
Code: Select all
<cms:pages masterpage='example.php' page_name='xyz' >
   <cms:show_repeatable 'my_images' >
      ...
   </cms:show_repeatable>
</cms:pages>

In the code above we are showing the repeatable region from a cloned page named 'xyz' of example.php. If example.php happens to be a non-cloned template, simply drop the 'page_name' parameter e.g.
Code: Select all
<cms:pages masterpage='example.php' >
   <cms:show_repeatable 'my_images' >
      ...
   </cms:show_repeatable>
</cms:pages>

Replying to your other query- there is no 'limit' parameter so to show only a limited number of rows we'll have to do the counting ourselves using the k_count variable e.g. as follows -
Code: Select all
<cms:pages masterpage='example.php' >
    <cms:show_repeatable 'my_images' startcount='0' >
        <cms:if k_count lt '10'>
        ...
        </cms:if>
    </cms:show_repeatable>
</cms:pages>

Hope it helps.



I got some question again about repeat thing, everything it's working that you said. But I wonder if I can do that, when the K_count its on 10, and when I have added 10 already, but when I add 11, I want to make so the first count removes and the newest added replace with it. I'm not sure if your understand hehe.
4 posts Page 1 of 1