A Smart Image Cropping Question

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

A Smart Image Cropping Question

Post by Andrew Prior »

Folks, I use the excellent Portage template for my website and have the Smart Image "Default location from which to "crop to fit" set to center crop.

I also set up a website for a workplace, and we looked at what we needed and paid money for a set of "bottom croppable" photos for the page headers.

But now I have a friend who is an accomplished photographer and who wants to use their existing photos. Here is the problem: Some of them clearly need to be set to center crop and others will only work if set to bottom crop. (And a few would work with crop right and crop left.)

I see in the help files there is the option to add the filter_croptofit attribute to a template where I can specify which crop to use, so if I am correct in my understanding of that filter, I could specify two or three templates which would allow said friend to choose the appropriate cropping for the relevant photo… except that Portage uses a master template. And as such, any template using Smart Image in the header gets the settings from that single master template. I can't see that I can set up multiple master templates 😊

Do I have any options here, or must I tell my mate Olly he has to suck up and choose only the photos that fit just one of the cropping defaults?

Andrea
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1807
Joined: Wed Feb 25, 2009 4:25 am

Re: A Smart Image Cropping Question

Post by DIGI3 »

You can pass variables from child templates to parent templates if you put them in scope. So in your master template if you had something like:

Code: Select all

{SmartImage src=$myimage filter_croptofit='1200,400,$location|default:c,1'}
Then in your child template something that passes $location as tl,tc,tr, etc., like {$location='tl' scope=global}. That could be a dropdown field (using ECB2, for example) or whatever method you want. I don't think you'd need a separate template for each crop type but that works if you want to.
Not getting the answer you need? CMSMS support options
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

Re: A Smart Image Cropping Question

Post by Andrew Prior »

Awesome! Thank you. I'll have a play :) Andrea
Post Reply

Return to “Modules/Add-Ons”