editing the view of the default image block

Permalink 1 user found helpful
hi.

i need to remove parts of the output of the image block. (remove the width="" and height="")

so i thought ok i will just copy the image block from concrete/blocks/image and then edit the view.php to not output the widths and heights that are playing havoc with my responsive design.

i find that the view just has:
<?php 
defined('C5_EXECUTE') or die("Access Denied.");
echo($controller->getContentAndGenerate());
?>


and the controller has:

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");   
   class ImageBlockController extends Concrete5_Controller_Block_Image {
   }


does anyone know how i can find the parts that output anything? as i dont know where to look next.

thanks :)

chris123uk
 
enlil replied on at Permalink Reply
enlil
everything you're looking for should be in the last block controller function:

function getContentAndGenerate
enlil replied on at Permalink Best Answer Reply
enlil
sorry, the base controller.php code you want to use for the controller is located in concrete/core/controllers/blocks/image.php

check out the block i posted here for a already working copy if you're interested. only modification made to it is appending base-url to href for rss feeds that pull images...

http://www.concrete5.org/community/forums/customizing_c5/full-url-i...
chris123uk replied on at Permalink Reply
chris123uk
ok thanks.

guess i would just need to comment out the one line:


//$sizeStr = ' width="' . $thumb->width . '" height="' . $thumb->height . '"';
enlil replied on at Permalink Reply
enlil
looks like it should work!
keeasti replied on at Permalink Reply
keeasti
I think this line is for the thumbnail .. did it work?
chris123uk replied on at Permalink Reply
chris123uk
hmm when i edit the concrete/core/controllers/blocks/image.php file nothing happens to the image.

even if i delete everything out of there and clear cache
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Try concrete/core/controllers/blocks/image.php
keeasti replied on at Permalink Reply
keeasti
I usually deal with the resizing of images in responsive designs by adding the following to the css:

img {
 max-width: 100%;
 height: auto;
}


I wonder if this would work for you
chris123uk replied on at Permalink Reply
chris123uk
yep thats what i use but in this case the html height was conflicting for some reason.