Page 1 of 1

Simple image upload/resize/insert workflow

Posted: Mon Jan 21, 2019 4:59 pm
by ooopie
I have many non-tech savvy clients using CMSMS to manage their websites, and they find it very straightforward, however they always struggle with inserting images into pages.

The workflow I suggest to them is:
- Upload image with the file manager (usually a large image from camera)
- Resize the image to suggested pixel dimensions using file manager
- Save resized image using file manager
- Go to the Content Page and insert the resized image, and hope the size looks right.

Is there a better workflow that I'm unaware of? I know CGSmartImage can help, but that would require my editors to use scary looking code. I try to use Content Image fields in my templates where I can, but sometimes I need the editors to have the freedom to place images along with their text content.

The ideal concept to me I think would be an option for CGSmartImage to replace IMG tags in the content with CGSmartImage calls, (physically resizing the image with the width and the height specified in the HTML).

How do you all help your clients with images?

Re: Simple image upload/resize/insert workflow

Posted: Mon Jan 21, 2019 5:17 pm
by calguy1000
You can use something like: {cgsi_convert max_width=300}{$some_wysiwyg_generated_content}{/cgsi_convert}

It has limited functionality to auto process IMG tags in the HTML that is inside of the block tag.

IIRC if you just have something like {cgsi_convert}<img src="images/something.jpg" width="400" height="300"/>{/cgsi_convert} then CGSI will resize the image to 400x300 automatically.

Re: Simple image upload/resize/insert workflow

Posted: Mon Jan 21, 2019 5:26 pm
by DIGI3
I use {cgsi_convert}{$content}{/cgsi_convert} like Calguy suggested for most projects. The WYSIWYG will apply width and height parameters to the img tag, so CGSI will resize the image accordingly. All the user has to do is drag the corner of the image to size it how they want in the content editor. Adding a max_width is a good safeguard in case they don't adjust the size.

Note that you may need to increase your PHP memory limit, large images use a lot of memory the first time the content is rendered - but after that it will be cached.

Re: Simple image upload/resize/insert workflow

Posted: Mon Jan 21, 2019 6:35 pm
by ooopie
Nice! I never knew of cgsi_convert

Thanks for sharing, that sounds perfect.