Using CG Smart Image with CG Blog

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
delve2013
Forum Members
Forum Members
Posts: 91
Joined: Thu Jan 31, 2013 4:23 pm

Using CG Smart Image with CG Blog

Post by delve2013 »

my client is uploading huge images to her blog, and I would like CG smart image to control the size of the images.

Can someone please explain what smarty code I need to add to my CGBlog detail template in order to show the image.

I have created an alias in CG Smart Image called "blog_img".

I just need a hand getting this into CGBlog.

???
Recon
Forum Members
Forum Members
Posts: 200
Joined: Sat Oct 09, 2010 10:23 am

Re: Using CG Smart Image with CG Blog

Post by Recon »

1) Create Image Field Definition name "CGimage"
2) Put this to your CGBlog template

{assign var='path value=$entry->file_location}
{assign var=image value=$entry->CGimage}

3) call smart image:

{CGSmartImage src1=$path src2=$image filter_croptofit="350,250,tc"} or filters what you need
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Using CG Smart Image with CG Blog

Post by velden »

I'd suggest:

Code: Select all

{CGSmartImage src1=$entry->file_location src2=$entry->CGimage filter_croptofit="350,250,tc"} or filters what you need
(Where image field definition name is 'CGImage')
delve2013
Forum Members
Forum Members
Posts: 91
Joined: Thu Jan 31, 2013 4:23 pm

Re: Using CG Smart Image with CG Blog

Post by delve2013 »

Thank you guys, I've got it working.

BUT..

How would the client go about adding more than one image to a blog post using this method?

Right now, they are using the new field definition to browse, and add an image. The CG smart image is not working for any images being added into the WYSIWYG area, ideally I would need this method to work.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Using CG Smart Image with CG Blog

Post by velden »

Read the help of CGSmartImage. It does support that.
delve2013
Forum Members
Forum Members
Posts: 91
Joined: Thu Jan 31, 2013 4:23 pm

Re: Using CG Smart Image with CG Blog

Post by delve2013 »

I've read the help and I still can't figure it out.
The examples it provides in the help section are for single images, and the cgsi_convert tag only works for regular {content} tags and does not work for the blog. I've tried wrapping cgsi_convert around my blog {content} tag and it fails to render the content when viewed in the browser.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Using CG Smart Image with CG Blog

Post by Dr.CSS »

I would teach my client how to optimize images for the web and to not waste bandwidth, server side storage of large images that you have to try and change/resize to work on the web...

Just mho...
Post Reply

Return to “Modules/Add-Ons”