Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hi, i have group image in repeatable region something like gallery and i want use thumbnail (croping) image. But i can't see in CMS.

Code is something like this:

Code: Select all
      <cms:editable name='group_gallery' label='group_gallery' desc='Gallery' order='55' type='group' />
      <cms:editable type='text' label='group_gallery' name='title_gallery' order='1' height='100' width='500' group='group_gallery'/>
      <cms:repeatable name='main_gal' label="Gallery" order='1' group='group_gallery'>      
         <cms:editable type='image' name='pic_gal' label='Picture' preview_width='300' order='2' group='group_gallery'/>
         <cms:editable name='pic_gal_thumb' label='Gal thumb' desc='Automatic' width='860' height='570' assoc_field='pic_gal' type='thumbnail'/>
         <cms:editable type='text' name='pic_gal_title' label='Title photo' order='3' maxlength='255' group='group_gallery'/>   
      </cms:repeatable>



Is it possible to have thumbnail in group repeatable region?

Tnx in advance!

Attachments

Hi,

Repeatable-region does not support type 'thumbnail' editable region.

The alternatives are -
1. Use the <cms:thumbnail> tag - https://docs.couchcms.com/tags-reference/thumbnail.html
2. Instead of repeatable-region, use mosiac (supports all types) - viewtopic.php?f=5&t=11105

Hope this helps
Try this
Code: Select all
  <cms:editable name='group_gallery' label='group_gallery' desc='Gallery' order='55' type='group' />
      <cms:editable type='text' label='group_gallery' name='title_gallery' order='1' height='100' width='500' group='group_gallery'/>
      <cms:repeatable name='main_gal' label="Gallery" order='1' group='group_gallery'>     
         <cms:editable type='image' name='pic_gal' label='Picture' show_preview='1' preview_width='300' order='2' />
         <cms:editable type='text' name='pic_gal_title' label='Title photo' order='3' maxlength='255' group='group_gallery'/>   
      </cms:repeatable>


You can set preview_width to '860' as you did in your code for the editable pic_gal.

I suppose this is what you are looking for. Do let me know.
Image
where innovation meets technology
KK sir has proposed a solution too, we almost posted at same time.
Image
where innovation meets technology
KK wrote: Hi,

Repeatable-region does not support type 'thumbnail' editable region.

The alternatives are -
1. Use the <cms:thumbnail> tag - https://docs.couchcms.com/tags-reference/thumbnail.html
2. Instead of repeatable-region, use mosiac (supports all types) - viewtopic.php?f=5&t=11105

Hope this helps


Tnx for solution this one working, if <cms:show_mosaic 'gallery' tiles='galleries'> is before first div it's not good on frontend. I just need maybe some if rule before first div to check if exist or not?

Code: Select all
               <div class="projects projects-gallery">
                  <div class="row">
                  <cms:show_mosaic 'gallery' tiles='galleries'>
                        <div class="col-12 col-md-6 col-lg-4 team-item">
                           <div class="project-panel">
                              <div class="project-panel-holder">
                              <a class="project-img" href="<cms:show img_gal />" title="<cms:show title_img />">
                                 <img src="<cms:show img_gal_thumb />" alt="<cms:show title_img />">                 
                              </a>         
                              </div>
                           </div>
                        </div>
                  </cms:show_mosaic>         
                  </div>
               </div>   
@misho86, apologies but I couldn't quite understand the question.

From what I could gather, mosiac suits your case but there is some problem while displaying it on the frontend, right?
If so, please post some screenshots or the outputted HTML to show us exactly what is not right.

Thanks.
KK wrote: @misho86, apologies but I couldn't quite understand the question.

From what I could gather, mosiac suits your case but there is some problem while displaying it on the frontend, right?
If so, please post some screenshots or the outputted HTML to show us exactly what is not right.

Thanks.


Sorry i will try to explain better.

Code: Select all
  <cms:show_mosaic 'gallery' tiles='galleries'>
               <div class="projects projects-gallery">
                  <div class="row">
               
                        <div class="col-12 col-md-6 col-lg-4 team-item">
                           <div class="project-panel">
                              <div class="project-panel-holder">
                              <a class="project-img" href="<cms:show img_gal />" title="<cms:show title_img />">
                                 <img src="<cms:show img_gal_thumb />" alt="<cms:show title_img />">                 
                              </a>         
                              </div>
                           </div>
                        </div>
                   
                  </div>
               </div>   
   </cms:show_mosaic>   


Now it's set like this. But mosaic need to start at this: <div class="col-12 col-md-6 col-lg-4 team-item">, but if set mosaic here i will have in code only this and on frontend it will be empty space:

Code: Select all

               <div class="projects projects-gallery">
                  <div class="row">
                  </div>
               </div>   


In other hand i need maybe some "if" condition at first <div class="projects projects-gallery"> to see if mosaic exist

Something like this:

Code: Select all
<cms:if  img_gal>
               <div class="projects projects-gallery">
                  <div class="row">
                  </div>
               </div>   
</cms:if>

Attachments

Ok, I get it now :) -
you do not want to output the enclosing HTML when <cms:show_mosaic> has nothing to show.

One way to do this is using the 'buffering' technique described in the Aurelius tutorial (https://docs.couchcms.com/tutorials/por ... -form.html) -
following which, instead of directly showing the mosaic output, we first save it in a buffer
Code: Select all
<cms:capture into='my_buffer'>
    <cms:show_mosaic 'gallery' tiles='galleries'>
        <div class="col-12 col-md-6 col-lg-4 team-item">
           <div class="project-panel">
              <div class="project-panel-holder">
              <a class="project-img" href="<cms:show img_gal />" title="<cms:show title_img />">
                 <img src="<cms:show img_gal_thumb />" alt="<cms:show title_img />">                 
              </a>         
              </div>
           </div>
        </div>
    </cms:show_mosaic>
</cms:capture>

Then, as the final step, we first check if there is anything at all in the buffer; if yes, we go ahead and output the enclosing HTML with the buffer contents within -
Code: Select all
<cms:if "<cms:strlen my_buffer />">
    <div class="projects projects-gallery">
      <div class="row">
        <cms:show my_buffer /> 
      </div>
    </div>
</cms:if>

Hope this helps.
Nice, this what i want. Thans a lot KK! :D :D
9 posts Page 1 of 1
cron