Closed (fixed)
Project:
Responsive images and styles
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2013 at 20:34 UTC
Updated:
21 Jan 2013 at 17:00 UTC
Fantastic Module and it works great however I'm trying to print the output straight from a .tpl file, like you can do with Image Styles.
This how I do it with Image Styles:
<img src="<?php print image_style_url('resp_img__team_member', $team[$idx]->field_team_image['und']['0']['uri']); ?>" />
I've searched but can't seem to find if anyone is/has done this. Any help would be appreciated!
Thanks.
Comments
Comment #1
attiks commentedWhy don't you just render the field using drupal_render.
If you want to do it for an image not attached to a node you need to use something like this
print theme('picture_formatter', array(
'breakpoints' => array(),
'item' => array(),
'style_name' => '',
'path' => '',
));
The easiest is to add dpm($variables) after line 314 so you'll see what you have to pass as arguments.
Comment #2
jeffglenn commentedYeah, you're completely right. I just wasn't thinking straight...
I used:
<?php print render($content['field_team_image']); ?>and it works perfectly.
Thanks
Comment #3
jeffglenn commentedComment #3.0
jeffglenn commentedWrapped my code in code tags