Advanced Image (Block and Helper)

Permalink 1 user found helpful
I created a slightly enhanced Image Block. It should be – cache-wise – backwards-compatible to the standard image block.

What's different?
1. No optional mouseover image (I just really would never need that, and it's confusing to editors)
2. Resize-Mode: Fit or Fill (currently just filled center-middle)
3. Slightly different resize behaviour (eg. I will also upscale if necessary)

There's a new helper file based on the image helper, which obviously should be put into the helpers directory.

Hope this is of any help for somebody :-)

2 Attachments

sklaus
 
kirkroberts replied on at Permalink Reply
kirkroberts
I just made an alternative Image block that keeps all the original options but adds the "fill" that sklaus mentions.

Crops the image within the max dimensions, and you can position it along the longer axis.

If that sounds good, here's where to find the block:
http://www.concrete5.org/community/forums/block_requests/image-bloc...
BigBobbyD replied on at Permalink Reply
BigBobbyD
How did you override the image helper?!

"Fatal error: Cannot redeclare class ImageHelper in /home/murray/public_html/helpers/image.php on line 20"
cherrycake replied on at Permalink Reply
cherrycake
you would need to extend it instead of just overriding it and add Site before the name..

like this

class SiteImageHelper extends ImageHelper {
  public function myCustomFunction() {
    return 'hola';
  }
}

same goes for extending all helper classes.