image sizes

Permalink
Hi
I'm new to concrete5. I'm just trying to get to grips with it.

Ive made a custom theme, blocks and set up the advanced permissions etc. So far it's excellent.

I'm stuck not been able to specify a fixed image size or resize the image on the fly.

The problem arose when showing the system to a friend, who immediately uploaded an image to the homepage which took up half the page and proclaimed "Ive broken it all ready".

Is there something I'm missing to stop a non-tech being able to adding huge images and braking the look of the site?

thanks for any help

Jon

 
ScottC replied on at Permalink Reply
ScottC
Hi Jon, no out of the box blocks right now allow you to specify a thumbnail size when adding an image.

If you are using an imageblock, you could add code to your view:

$fo = $controller->getFileObject(); 
print '<a href="' . $fo->getFileRelativePath() . '">'; 
$fo->outputThumbnail(400, 400); 
print '</a>';


This would give you a thumbnail at a height or width of 400 and link to normal image. This would go in the block directory under view.php.
jonnym replied on at Permalink Reply
Thanks for the reply and sorry for the slow follow up.

Ive tried putting the code in view.php under concrete5/blocks/image/view.php and adjusting the file under concrete5/concrete/blocks/image/view.php, but I couldn't get it to work. Any chance you could flesh out the instructions for a newbie?

thanks Jon
Tony replied on at Permalink Reply
Tony
I think Remo's zoom image block might take care of this problem (it lets you specify the initial image size):

http://www.concrete5.org/marketplace/addons/zoom_image...

If you don't want the enlargement when you click it, you could hack the block to do what you want pretty easily.
jonnym replied on at Permalink Reply
perfect!


thanks for the help
Jon