Page 1 of 1

[Solved]CGSmartImage - not sure how to use

Posted: Wed Aug 21, 2013 2:38 am
by jasnick
From the Help section: The simplest way to use this module is to use it in the same place you would the {image} tag. I.e: Something like {CGSmartImage src='uploads/images/picture.jpg'}

Does this mean this is a replacement in HTML for <img src='uploads/images/picture.jpg'>?

From the Help section: Simplicity: The filtering capabilities of CGSmartImage allow you to automatically process images for consistent and secure display, without site editors having to play with them. They can upload larger images, and your site will just handle them properly.

So does this mean that in a page template I add {cgsi_convert}{/cgsi_convert} around the content so the WYSIWYG editor can be used to add images as it currently does?

Where do I enter the size needed and other factors so that all the editor has to do is upload?

This is what I need so that an editor can simply add an image without having to optimise, scale etc etc.

I am confused as to how I go about using CGSmartImage for example, in the Products Module. I have many image fields as the editor will be uploading up to 10 images for each product. How do I use this in Products?

It all sounds very useful if only I can work out how to use it.

Thanks

Re: CGSmartImage - not sure how to use

Posted: Thu Aug 22, 2013 11:15 am
by velden
jasnick wrote:From the Help section: The simplest way to use this module is to use it in the same place you would the {image} tag. I.e: Something like {CGSmartImage src='uploads/images/picture.jpg'}

Does this mean this is a replacement in HTML for <img src='uploads/images/picture.jpg'>?
Kind of indeed. But typically you provide some extra parameters.

For example:

Code: Select all

{CGSmartImage src="`$entry->file_location`/`$entry->fields.foto->value`" filter_resize='w,224' width='224' style='margin-left : -25px;'}
jasnick wrote: From the Help section: Simplicity: The filtering capabilities of CGSmartImage allow you to automatically process images for consistent and secure display, without site editors having to play with them. They can upload larger images, and your site will just handle them properly.

So does this mean that in a page template I add {cgsi_convert}{/cgsi_convert} around the content so the WYSIWYG editor can be used to add images as it currently does?
Yes
jasnick wrote: Where do I enter the size needed and other factors so that all the editor has to do is upload?
Though never used it myself, I'd assume inside the {cgsi_convert} tag.
jasnick wrote: This is what I need so that an editor can simply add an image without having to optimise, scale etc etc.

I am confused as to how I go about using CGSmartImage for example, in the Products Module. I have many image fields as the editor will be uploading up to 10 images for each product. How do I use this in Products?
See my example above. It comes from a news template, but you can probably do it the same way with products.
Read the help carefully for all available parameters.

Re: CGSmartImage - not sure how to use

Posted: Thu Aug 22, 2013 11:33 pm
by jasnick
Thanks velden

Very clear explanation - I can now see how it is suppposed to work. I'll experiment and see how I get on.

Thanks again :)