Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hi guys,

I have tried reading a forum post about 'buffering' data and have used an example provided by KK in the post but I can't seem to get it working for a website that I am working on.

I am obviously doing something wrong but I can't seem to figure out what?

Here is my code:
Code: Select all
<cms:capture into='my_buffer'>
    <section class="content introduction">
       <div class="row">
          <div class="columns medium-12 small-12">
             <h1>Gallery</h1>
             
             <ul class="medium-block-grid-4 small-block-grid-1">
                <cms:show_repeatable 'gallery'>
                   <li>
                      <a href="<cms:thumbnail image width='1000' height='1000' />" data-lightbox="gallery-1" data-title="<cms:show caption />">
                         <img src="<cms:thumbnail image width='270' height='270' />" alt="<cms:show caption />" />
                      </a>
                   </li>
                </cms:show_repeatable>
             </ul>
          </div>
       </div>
    </section>
</cms:capture>

<cms:if show_buffer><cms:show my_buffer /></cms:if>
I only want to show that entire section if the repeatable 'gallery' contains an image.

What have I done that is incorrect?
- Dan

Problem solved!

For anyone else that struggles with a similiar issue, here is my code:
Code: Select all
<cms:capture into='page_gallery'>
   <section class="content introduction">
      <div class="row">
         <div class="columns medium-12 small-12">
            <h1>Gallery</h1>

            <ul class="medium-block-grid-4 small-block-grid-1">
               <cms:show_repeatable 'gallery'>
                  <li>
                     <a href="<cms:thumbnail image width='1000' height='1000' />" data-lightbox="gallery-1" data-title="<cms:show caption />">
                        <cms:if "<cms:not_empty image />">
                           <img src="<cms:thumbnail image width='270' height='270' />" alt="<cms:show caption />" />
                           <cms:set has_image='1' 'global' />
                        </cms:if>
                     </a>
                  </li>
               </cms:show_repeatable>
            </ul>
         </div>
      </div>
   </section>
</cms:capture>

<cms:if has_image>
   <cms:show page_gallery />
</cms:if>
- Dan
2 posts Page 1 of 1
cron