Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
I am embedding logos into a slider that I have set up as a repeatable region within a globals template. Whatever I seem to try, it prints all of the logos in the slider instead of separate sections that slide. Can this be accomplished with the way I have set things up?

Current Code:
Code: Select all
<div class="item active">
                     <ul>
                        <cms:pages masterpage='globals.php' limit='8' folder=k_folder_name >
                           <cms:set my_loop_count="<cms:zebra '1' '2' '3' '4' />" 'global' />
                           <cms:if my_loop_count le '4'>
                              <cms:show_repeatable 'brands'>
                                 <li class="col-md-3">
                                    <a><img src="<cms:show brand_img />" title="<cms:show brand />" alt="<cms:show brand />"/>
                                    </a>
                                 </li>
                              </cms:show_repeatable>
                           </cms:if>
                           <cms:if my_loop_count='5'>
                                 </ul>
                              </div>
                              <div class="item">
                                 <ul>
                           </cms:if>
                           <cms:if (my_loop_count lt '8') && (my_loop_count ge '5')>

                                 </ul>
                              </div>
                        </cms:if>
                     
                     </cms:pages>


What I am trying to accomplish:
Code: Select all
<!-- 1 -->
                            <div class="item active">
                                <ul>
                                    <li class="col-md-3">
                                        <a><img src="images/store-1.png" title="" alt=""/>
                                        </a>
                                    </li>
                                    <li class="col-md-3">
                                        <a><img src="images/store-2.png" title="" alt=""/>
                                        </a>
                                    </li>
                                    <li class="col-md-3">
                                        <a><img src="images/store-3.png" title="" alt=""/>
                                        </a>
                                    </li>
                                    <li class="col-md-3">
                                        <a><img src="images/store-4.png" title="" alt=""/>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <!-- .1 -->

                            <!-- 2 -->
                            <div class="item">
                                <ul>
                                    <li class="col-md-3">
                                        <a><img src="images/store-5.png" title="" alt=""/>
                                        </a>
                                    </li>
                                    <li class="col-md-3">
                                        <a><img src="images/store-1.png" title="" alt=""/>
                                        </a>
                                    </li>
                                    <li class="col-md-3">
                                        <a><img src="images/store-2.png" title="" alt=""/>
                                        </a>
                                    </li>
                                    <li class="col-md-3">
                                        <a> <img src="images/store-3.png" title="" alt=""/>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <!-- .2 -->

Hi Jon,

I see that you are using limit='8' with cms:pages
Code: Select all
<cms:pages masterpage='globals.php' limit='8'

The intention seems to be to restrict the number of logos to eight.
The would work if globals.php is a clonbable template where each logo is a cloned page.

I suspect, however, that the globals.php in your case is not a clonable template - rather it is a simple template with a repeatable-region with many rows of logos and you wish to show a maximum of eight rows of the repeatable-region.

Am I wrong? Please let me know.
Also please post the cms:template block of globals.php for us to know how you have defined the editable regions.

Thanks.
That is correct and here is the globals template:

<?php require_once( 'cms/cms.php' ); ?>
<cms:template title='Global Settings' executable='0' order='10'>
<cms:editable name='site_name' label='Site name' type='text' order='9' />
<cms:editable name='fb_link' label='Facebook URL' type='text' order='20' />
<cms:editable name='twitter_link' label='Twitter URL' type='text' order='30' />
<cms:editable name='google_link' label='Google + URL' type='text' order='40' />
<cms:editable name='instagram_link' label='Instragram URL' type='text' order='42' />
<cms:editable name='email' label='Email' type='text' order='43' />
<cms:repeatable name='brands' label='Brand logos' order='50' >
<cms:editable type='image' name='brand_img' label='Brand logo' desc='262x142' show_preview='1' crop='1' width='262' height='142' preview_width='100' />
<cms:editable name='brand' label='Brand name' type='text' />
</cms:repeatable>
</cms:template>
<?php COUCH::invoke(); ?>
Figure it out. I removed the brands repeatable region from the globals template, created a brands clonable template and it works like a charm. Thanks KK!
That's a perfectly reasonable alternative :)
5 posts Page 1 of 1