Projet

Général

Profil

Paste
Télécharger (2,61 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / field_collection / README.txt @ 950416da

1
Field collection
2
-----------------
3
Provides a field collection field, to which any number of fields can be attached.
4

    
5
Each field collection item is internally represented as an entity, which is
6
referenced via the field collection field in the host entity. While
7
conceptually field collections are treated as part of the host entity, each
8
field collection item may also be viewed and edited separately.
9

    
10

    
11
 Usage
12
 ------
13

    
14
  * Add a field collection field to any entity, e.g. to a node. For that use the
15
   the usual "Manage fields" interface provided by the "field ui" module of
16
   Drupal, e.g. "Admin -> Structure-> Content types -> Article -> Manage fields".
17

    
18
  * Then go to "Admin -> Structure-> Field collection" to define some fields for
19
   the created field collection.
20

    
21
  * By the default, the field collection is not shown during editing of the host
22
    entity. However, some links for adding, editing or deleting field collection
23
    items is shown when the host entity is viewed.
24

    
25
  * Widgets for embedding the form for creating field collections in the
26
    host-entity can be provided by any module. In future the field collection
27
    module might provide such widgets itself too.
28

    
29

    
30
 Using field collection with entity translation
31
 -----------------------------------------------
32

    
33
  * Field collection items must be selected as a translatable entity type at
34
    Admin -> Config -> Regional -> Entity Translation.
35

    
36
  * The common use case is to leave the field collection field untranslatable
37
    and set the necessary fields inside it to translatable.  There is currently
38
    a known issue where a host can not be translated unless it has at least
39
    one other field that is translatable, even if some fields inside one of
40
    its field collections are translatable.
41

    
42
  * The alternate use case is to make the field collection field in the host
43
    translatable.  If this is done it does not matter whether the inner fields
44
    are set to translatable or not, they will all be translatable as every
45
    language for the host will have a completely separate copy of the field
46
    collection item(s).
47

    
48
  * When using nested field collections the configuration of the fields and
49
    field collections is very important. The recommended approach is to first
50
    enable entity translation as defined in step 1, and set the outer 
51
    field collection field as translatable, and all it’s sub-fields to language
52
    undefined. Also the sub-field collections and it’s sub-fields should be
53
    set to language undefined. This will ensure that every language of the host
54
    will have a completely separate copy of the field collection item(s) and
55
    it’s fields.