Image block that is 90 x 90

Permalink
I have a section with 4 images that have to be 90 x 90.

I know it's a section that clients will change.

If I use an image block, and the client swaps in a new image, I'd like it to remain 90 x 90 (i.e. if they upload something new, I'd like concrete5 to shrink the file size down to a 90 x 90 image like it does when you set the max dimensions in the regular image block).

Is this something I can do with the regular image block (i.e. swap a current image with a new one that is sized down - both in terms of file size and visual size) or is there a simple way to copy the image block and just modify it a little to do this?

 
DeWebmakers replied on at Permalink Reply
DeWebmakers
add:
.class_of_your_div .img {width:90px;height:90px;}

to your stylesheet.

The problem with this is that users can upload large images so the pageload gets affected.
JohntheFish replied on at Permalink Reply
JohntheFish
If you want to do it in code, you could make a custom template of the image block

http://www.concrete5.org/documentation/how-tos/developers/change-th...

and either (or both)

- fix the output style as @corretje has noted

- resize the images using the image helperhttp://www.concrete5.org/documentation/developers/files/helpers/...

The image helper caches results, so no need to worry about repeated calls. There is also an undocumented parameter that crops images to fit a box, so you can keep your images perfectly square.

You may also be able to get the designer content block to create a block that does this all for you.

http://www.concrete5.org/marketplace/addons/designer-content/...

Another solution is to use the file set list block:

http://www.concrete5.org/marketplace/addons/list-files-from-set/...

I have posted a thumbnail list template on the forum for that block that includes most of what you need, just change the thumbnail dimensions and container widths to fit your layout.

Finally, there are some gallery blocks that could be used to do the same thing.