Closed (fixed)
Project:
Custom Formatters
Version:
7.x-2.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2011 at 03:19 UTC
Updated:
1 Dec 2011 at 04:10 UTC
Hi All,
I've been messing with this for a while and can't seem to get this working. I'm using the Field Collection module and print_r($variables['#items']) in the preview outputs the following.
Array
(
[0] => Array
(
[value] => 12
)
)
I'm trying to place each field collection in an HTML UL. I was going to try using theme_item_list() but can't figure out how to get to the actual values in my field collection instead of just the ID of the field collection (12).
Does anyone have an example of how to use a custom formatter with field collections?
Thanks for reading,
-Tim
Comments
Comment #1
decipheredYou'll need to load the Field Collection data from the ID:
Custom Formatters can only provide you with the data that the fields provide it with, which in this case is simply the ID.
Comment #2
TimG1 commentedExcellent, didn't know about field_collection_item_load(). Thanks Deciphered!
-Tim