Render image with picture and view_field_value

Created on 27 September 2016, about 8 years ago
Updated 19 September 2023, about 1 year ago

Hello,

I want use view_field_value and picture mappings to render images in specific templates.
But the image isn't rendered.
Here is my code

<?php
     $display_settings = array(
          'label' => 'hidden',
          'type' => 'picture',
          'settings' => array(
		'picture_mapping' => 'Background',
		'fallback_image_style' => 'content',
          ),
     );
     $output = field_view_field('taxonomy_term', $term, 'field_image', $display_settings);
     print render($output);
?>

Is it possible to define the "picture mapping" and the "fallback image" in the settings? In my code, if I delete the part 'settings' (with "picture_mappings" and "fallback image"), my image is rendered, but with a wrong picture mapping.

Thanks for your help !! ;)

💬 Support request
Status

Closed: outdated

Version

2.13

Component

Code

Created by

🇫🇷France kumkum29

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom lesleyfernandes

    I am closing all very old tickets that have not received comments for a long time. If someone is still facing these issues, please reopen it. Feel free to contribute with more info or a patch.

Production build 0.71.5 2024