Field Collection

Description  :

Provides a field-collection field, to which any number of fields can be attached.

A field collection is internally represented as an entity, which is embedded in the host entity. Thus, if desired field collections may be viewed and edited separately too.

Download:

https://drupal.org/project/Field_Collection

Video Link :

Syntax:

To Display Field Collection

$formtype = field_get_items(‘node’, $node, ‘field_non_rohs’);

foreach($formtype as $itemid) {
$item = field_collection_field_get_entity($itemid);

To Display Field Collection in a Field Collection

$formtype1 = field_get_items(‘field_collection_item’, $item, ‘field_safety_standard_non_rohs’);
foreach($formtype1 as $itemid1) {
$item1 = field_collection_field_get_entity($itemid1);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s