Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi All,
I don't know whether this is the right place to ask or should it be in view_php module issue queue. Let me just place in two places.
Normally, I can retrieve a field value under View PHP (http://drupal.org/project/views_php) through $data. But for the special field of type field collection. I don't know how to retrieve its items.
Say I have a field_collection in content type A
There are two fields under this field_collection called
field_item1
field_item2
How can I retrieve field_item1 and field_item2 value in the View PHP in order to do some further processing?
Thanks
Comments
Comment #1
truyenle CreditAttribution: truyenle commentedDidn't mean to bump it up, but I can't figure out how. Anyone?
Comment #2
truyenle CreditAttribution: truyenle commentedI got it finally, here is the code
collection field: field_banner_videos
collection items:
field_video_url
field_custom_thumbnail
Thanks
Comment #3
RedJane CreditAttribution: RedJane commentedPfew... :-/
Tried already a lot... but still no luck.
Is there another solution for this? Thank you !
(Using beta5)
Comment #4
RedJane CreditAttribution: RedJane commentedok... finaly found it using field_collection_item_load()
Me Happy.
Comment #5
nasia123 CreditAttribution: nasia123 commentedIt would be nice to display your solution also with field_collection_item_load()