Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Bumped by Community user
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Source Link
Matt Coady
  • 209
  • 1
  • 8

Get the url for an images in a Field Collection for the Node Template

This is a bit messy so bear with me. I've built a node with a field collection 'field_meet_videos'. That field collection contains another field collection 'field_about_video'. The inner field collection has 3 fields (two text fields and an image field 'field_image'). This field collection is also used as multifield so it'll be used more than once (lets say 3 times for this example).

What I'm trying to do is just get a printed output of the image url (with imagecache style) on the node template (to use them as html element backgrounds).

<?php
  $content['field_meet_videos'][0]['entity']['field_collection_item'][34]['field_about_video'][0]['entity']['field_collection_item'][35]['field_image']
?>

This looks to contain enough that I could cobble together a url by sticking these variables into a url string but it feels like there must be a better way to access these variables.