Jump to content

Multipart field

From EPrints Documentation


Description[edit]

This field is similar to a Compound field but only intended for single sets of values (i.e. multiple => 0). So that it can be used to build complex fields like the Name field.

Inheritance[edit]

Additional Properties[edit]

Name Default Value Required Description Notes
fields n/a YES The sub-fields of the main field
fields_cache n/a NO A cache of the sub-fields This property is generated from fields.
fields_index {} NO Index of sub_name to field object This property is generated from fields.

Required Phrases[edit]

In addition tothe standard metadata field phrasestype. The sub-field names in the form:

 datasetid + "_fieldname_" + fieldname + "_" + subfieldname

Individual fieldhelp phrases are not required the help for sub-fields should be included in the fieldhelp for the main field.

Database[edit]

Multipart fields are stored in the database as multiple fields, whose types are determined in the sub-field configuration.

API[edit]

See API page.

Examples[edit]

Most basic example.

{
    name => 'email',
    type => 'multipart',
    fields => [
        {
            sub_name => 'subject'
            type => 'text'
        },
        {
            sub_name => 'body'
            type => 'longtext'
        },
}