cgsi_convert CGSmartImage

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
musicscore
Power Poster
Power Poster
Posts: 444
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

cgsi_convert CGSmartImage

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: cgsi_convert CGSmartImage

Post 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}
Not getting the answer you need? CMSMS support options
musicscore
Power Poster
Power Poster
Posts: 444
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

[Solved] cgsi_convert CGSmartImage

Post 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.
Post Reply

Return to “Modules/Add-Ons”