Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Goodmorning everyone!

I have an issue with - I suppose - repeatable regions and links.
I have projects in a carousel. Each project, when clicked, opens a lightbox gallery with other images from that project. These images are simply in <a> tags with no style attached, so they are not visible from user.
Everything works as expected, but the only problem I have is that only one link is repeated multiple times, even outside its container, and so it gives problems in the layout.

The code in the masterpage:
Code: Select all
<cms:template title='Realizzazioni' clonable='1' dynamic_folders='1'>
   
    <cms:editable type='image' name='real_immagine' label='Immagine principale'/>
    <cms:editable type='richtext' name='real_desc' label='Descrizione'/>
    <cms:repeatable name='real_gallery' label='Gallery'>
        <cms:editable name='gallery_img' label='Immagine' type='image'/>
        <cms:editable name='gallery_text' label="Titolo dell'immagine" type='text'/>
    </cms:repeatable>
    <cms:editable name='data_realizzazione' label="Data realizzazione" type='datetime' format='dmy'/>
    <cms:editable name='categoria' label="Categoria" type='dropdown' opt_values='Residenziale | Commerciale'/>
    <cms:editable type='text' name='dove' label='Dove'/>

</cms:template>


The code involved in index.php
Code: Select all
<section class="wrap wrap--w1790 p-b-75 p-t-60">
                <div class="section-title m-b-70">
                    <h5 class="title-sub">Realizzati con sistemi costruttivi MBA GREEN BUILD<sup>TM</sup></h5>
                    <h2 class="title-1">Realizzati con MBA</h2>
                </div>
                <div class="container-fluid">
                    <div class="owl-carousel owl-project js-owl-wrapper">
                        <cms:pages masterpage='costruire-con-mba/realizzazioni.php' orderby='publish_date' limit='8'>
                            <div class="slick-item">
                                <article class="media media-project">
                                    <figure class="media__img">
                                        <img src="<cms:show real_immagine/>" alt="<cms:show k_page_title/>" />
                                    </figure>
                                    <div class="bg-overlay"></div>
                                    <span class="line"></span>
                                    <span class="line line--bottom"></span>
                                    <div class="media__body">
                                        <h3 class="title">
                                            <a href="<cms:show real_immagine/>" data-lightbox="<cms:show k_page_name/>"><cms:show k_page_title/></a>
                                        </h3>
                                        <div class="address"><cms:show categoria/></div>
                                    </div>
                                </article>
                            </div>
                        </cms:pages>
                    </div>
                    <div>
                     <cms:pages masterpage='costruire-con-mba/realizzazioni.php'>
                         <cms:show_repeatable 'real_gallery'>
                             <a href="<cms:show gallery_img/>" data-lightbox="<cms:show k_page_name/>" data-title="<cms:show gallery_text/>" class="p-0"/>
                         </cms:show_repeatable>
                     </cms:pages>
                 </div>
                </div>
            </section>


Here a screenshot of the compiled code with the issue. As you can see, the highlighted "a" tag repeats itself multiple times, even outside its container. :|

Image

Another problem is, the repeated link also appears in the lightbox, as if there are more images (the images loaded in the backend are actually 3).

Image

Can someone help me figure out what the problem is? :?:
Many thanks!

Bianca
Bianca,

The problem is with this piece -
Code: Select all
 <cms:pages masterpage='costruire-con-mba/realizzazioni.php'>
    <cms:show_repeatable 'real_gallery'>
       <a href="<cms:show gallery_img/>" data-lightbox="<cms:show k_page_name/>" data-title="<cms:show gallery_text/>" class="p-0"/>
    </cms:show_repeatable>
</cms:pages>


It outputs as many times as many cloned pages are in your template (without constraints). I see, the repeatable is used to create an 'inner' gallery to a portfolio item (one of those 8 items). It is possible that this second cms:pages loop is redundant.
trendoman wrote: Bianca,

The problem is with this piece -
Code: Select all
 <cms:pages masterpage='costruire-con-mba/realizzazioni.php'>
    <cms:show_repeatable 'real_gallery'>
       <a href="<cms:show gallery_img/>" data-lightbox="<cms:show k_page_name/>" data-title="<cms:show gallery_text/>" class="p-0"/>
    </cms:show_repeatable>
</cms:pages>


It outputs as many times as many cloned pages are in your template (without constraints). I see, the repeatable is used to create an 'inner' gallery to a portfolio item (one of those 8 items). It is possible that this second cms:pages loop is redundant.


Hello Trendoman, thank you for you time!

First of all, the inner gallery must be created for all portfolio items. But the problem is, I cannot put the
Code: Select all
<cms:show_repeatable 'real_gallery'>
       <a href="<cms:show gallery_img/>" data-lightbox="<cms:show k_page_name/>" data-title="<cms:show gallery_text/>" class="p-0"/>
    </cms:show_repeatable>

inside the <cms:pages> tag used to display the portfolio items, as they are in a carousel...
I just tried that but it obviously outputs a wrong layout... And anyway the links are still repeated also outside their container :(
trendoman wrote: Bianca,

The problem is with this piece -
Code: Select all
 <cms:pages masterpage='costruire-con-mba/realizzazioni.php'>
    <cms:show_repeatable 'real_gallery'>
       <a href="<cms:show gallery_img/>" data-lightbox="<cms:show k_page_name/>" data-title="<cms:show gallery_text/>" class="p-0"/>
    </cms:show_repeatable>
</cms:pages>


It outputs as many times as many cloned pages are in your template (without constraints). I see, the repeatable is used to create an 'inner' gallery to a portfolio item (one of those 8 items). It is possible that this second cms:pages loop is redundant.


Ops... I found the problem. The "a" tag was not correctly closed :?
I'm sorry if I wasted your time for this stupid error! Thanks again for your time! :)
The "a" tag was not correctly closed
Sorry, I thought we discuss backend issues here. :D
5 posts Page 1 of 1