Page 1 of 1

cgsi_convert CGSmartImage

Posted: Fri Jul 12, 2019 4:03 pm
by musicscore
I need 2 image on my page on the right side with a max-width of 240px.
The customer can select the images so the image may be very big.
I want to use CGSmartImage to resize the images and have this code in my template:

Code: Select all

 {cgsi_convert filter_resize='w,240'}
         <!-- content-right-pagina-image -------------------------------------->
         <div id="content-right-pagina-image-1">
                  <img src="{content_image block='pagina-afbeelding-1' dir='images/pagina' class='page-image' urlonly='1'}">
         </div>
         <!-- content-right-pagina-image-1 ------------------------------------>

         <!-- content-right-pagina-image-2 ------------------------------------>
         <div id="content-right-pagina-image-2">
                  <img src="{content_image block='pagina-afbeelding-2' dir='images/pagina' class='page-image' urlonly='1'}">
         </div>
         <!-- content-right-pagina-image-2 ------------------------------------>
{/cgsi_convert}
The images show up on the page but full size. How can I tell CGSmartImage to resize the images to a max-width of 240px.

I tried several combinations, search this forum but was unable to resize these image to 240px width use cgsi_convert.

Please help.

TIA
CMSMadeSimple 2.2.10
CGSmartImage 1.22.7

PHP version 7.3

Re: cgsi_convert CGSmartImage

Posted: Fri Jul 12, 2019 4:24 pm
by DIGI3
{cgsi_convert max_width=240} could do it

but you also have the option of converting it before output on the specific blocks instead of using the wrapper (code may not be exactly right but gives you the idea):

Code: Select all

{$url={content_image block='pagina-afbeelding-1' dir='images/pagina' urlonly=1}}
{CGSmartImage src=$url filter_resize='w,240' class='page-image' noembed=1}

[Solved] cgsi_convert CGSmartImage

Posted: Sun Jul 14, 2019 9:04 am
by musicscore
Thank you DIGI3

After modifying my template again and again without any luck I started changing the CGSmartImage setting and it turned out the the problem was in the CGSmartImage settings. After changing some settings it worked.

Thank you for your response.