🇮🇳India @garglalit0

Account created on 22 January 2018, almost 7 years ago
  • Senior Software Engineer at Digitas 
#

Recent comments

🇮🇳India garglalit0

this will work in drupal 9 and 10 to get the image url programitically

$image = $node->get('field_image_name')->getValue()[0]['target_id'];
$image = \Drupal::entityTypeManager()->getStorage('file')->load($image)->getFileUri();
$image_url = \Drupal::service('file_url_generator')->generateAbsoluteString($image);

🇮🇳India garglalit0

this will work in drupal 9 too get the image url

$image = $node->get('field_image_name')->getValue()[0]['target_id'];
$image = \Drupal::entityTypeManager()->getStorage('file')->load($image)->getFileUri();
$image_url = \Drupal::service('file_url_generator')->generateAbsoluteString($image);

Production build 0.71.5 2024