Drupal 7 Get image field path

后端 未结 5 1590
悲哀的现实
悲哀的现实 2021-01-30 18:06

I would like to get the image path of a field. I\'m in a node and I need the Url of image in order to put it as a background-image in inline css. I can\'t find the solution. Can

5条回答
  •  粉色の甜心
    2021-01-30 19:00

    to get image style url:

    $field = field_get_items('node', $node, 'field_image');
    $image_url = image_style_url('landingpage_slider', $field[0]['uri']);
    

提交回复
热议问题