Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
EDIT: I've woken up now ... I missed off
Code: Select all
<cms:set show_buffer='1' 'global' />
!!

hi all ... sorry to say I've been here before and referred back to this topic on how to prevent output if the repeatable region contains no data http://www.couchcms.com/forum/viewtopic.php?f=4&t=7146&p=9647&hilit=repeatable+empty#p9647

My code is
Code: Select all
         <cms:capture into='my_buffer'>
            <h1>Reviews</h1>
            <cms:show_repeatable 'recording_reviews' >   
               <cms:if "<cms:not_empty review_text />">
                  <blockquote><cms:show review_text /><cite><cms:show review_source /></cite></blockquote>
               </cms:if>
            </cms:show_repeatable>   
         </cms:capture>
         
         <cms:if show_buffer ><cms:show my_buffer /></cms:if>


But whether or not there is content in the repeatable regions I am getting no output at all when the <cms:capture> is wrapped around it.

Has something else changed? Is something staring me in the face that I can't see?!? The site is on my local machine - so not viewable I'm afraid.
Hi potato,

I'll give you a hint -
there is a line in your code where you check for a flag and then print the buffered output accordingly
<cms:if show_buffer ><cms:show my_buffer /></cms:if>

However, do you see this flag being set anywhere in the code preceding the line? :)

Anyways, I think following should work
Code: Select all
<cms:capture into='my_buffer'>
<h1>Reviews</h1>
<cms:show_repeatable 'recording_reviews' >   
   <cms:if "<cms:not_empty review_text />">
      <blockquote><cms:show review_text /><cite><cms:show review_source /></cite></blockquote>
      <cms:set show_buffer='1' 'global' />
   </cms:if>
</cms:show_repeatable>   
</cms:capture>

<cms:if show_buffer ><cms:show my_buffer /></cms:if>

Hope this helps.
thanks KK - my EDIT just crept in before your post - sorry to waste your time! I should have deleted the post ...

I found that I needed to set the scope to 'global' on the initial setting of the indicator show_buffer.

For anyone else finding this post in the future here it is:
Code: Select all
<cms:set show_buffer='0' 'global' />
<cms:capture into='my_buffer'>
   <h1>Reviews</h1>
   <cms:show_repeatable 'recording_reviews' >   
      <cms:if "<cms:not_empty review_text />">
         <blockquote><cms:show review_text /><cite><cms:show review_source /></cite></blockquote>
         <cms:set show_buffer='1' 'global' />
      </cms:if>
   </cms:show_repeatable>   
</cms:capture>
<cms:if show_buffer ><cms:show my_buffer /></cms:if>
3 posts Page 1 of 1
cron