My field_image is not rendering on user-profile.tpl. I have the following code (two different ways to render for testing):
$image = field_get_items('user', $user, 'field_image');
$output = field_view_value('user', $user, 'field_image', $image[0], array(
'type' => 'image',
'settings' => array(
'image_style' => 'header_image_160x160',
),
));
print render($output);
This produces the following in html:
<img src="https://coinme.io/sites/default/files/styles/header_image_160x160/public?itok=f31sbmSd" width="160" height="160" alt="">
I get the dead image logo. It is missing the final part of the file structure. And this is how I normally render:
$to_render = field_view_field('user', $user, 'field_image', array('settings' => array('image_style' => 'header_image_160x160'))); print render($to_render);
This is showing the default image, even though the image does exist:
I have the same field in a content type which is rendering correctly (only difference being the $user user -> $node node.
<?php $to_render = field_view_field('node', $node, 'field_image', array('settings' => array('image_style' => 'header_image_160x160'))); print render($to_render);?>
So it appears that when using user-profile specifically is the issue. I have also tried adding a new field type and same effect. Any suggestions?
Thanks, Paul.
$user
is in scope and that the field name isfield_image
? It looks like one of those things is causing the actual filename to be unavailable.