I have a site I'm working on where images are inserted into the body of blog nodes and I'm wanting to return these images in a view. I'm using computed field to successfully return the url of the images in the view, but I would like to apply an imagecache style to this before displaying it using
<img src = "[computed_field]">
Does anyone know the best way to do this? I've been searching around and have not been able to successfully do this yet. Thanks!
image_style_url
function in your computed field so that the image URL is already set to your desired style, however you've not specified whether you need the original URL as well.preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $entity->body[LANGUAGE_NONE][0]['value'], $matches); $entity_field[0]['value'] = $matches['1']['0'];
Any chance you can help me add in theimage_style_url
code to that function? For now I just cropped the images with CSS which works fairly well, but I'd love to wrap my head around this. Thank you for your help!