Drupal Association members fund grants that make connections all over the world.
The Field Collection module is the successor to the CCK3 Multigroup. It allows a set of fields to be combined together and treated as a single field. For example, a field collection named Playlist can be created consisting of the text fields Song and Artist. When a Playlist entry is created the Song and Artist fields are presented together as elements of the Playlist field.
When the Field Collection module is installed a new Field type named 'field collection' becomes available in the Manage fields tab of supported entities. In a basic Drupal installation these are:
- Content types
e.g. Home > Administration > Structure > Content types > Basic page > Manage fields
Home > Administration > Configuration > People > Account settings > Manage fields
e.g. Home > Administration > Structure > Taxonomy > Tags > Manage fields
Manage or adding a field collections
After the field collection field is created it's managed under from Home > Administration > Structure > Field collections. This is where fields are added to the field collections created in the Manage fields tab.
There is one permission, Administer field collections. It allows the holder to create and delete fields on field collections.
Make sure both the Field Collection and Field UI modules are enabled to follow this tutorial.
You are creating music playlists, which consists of multiple songs. Each song has a specific song name and artist.
- Go to admin/structure/types/add. Create a new content type: Playlist
- Add a new field to it: Track
- type: Field collection
- widget: Embedded
- number of values: Unlimited)
- Go to admin/structure/field-collections and click on "Manage fields" for the created Track field
- Add two fields to it: Song, Artist (type Text)
When you now add a new node of type "Playlist" you can add as many tracks to it as you like.