Difference between revisions of "Name field"

From EPrints Documentation
Jump to: navigation, search
(Properties)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{fieldtypes}}
 
{{fieldtypes}}
__NOTOC__
 
== Inheritance ==
 
  
* [[Metadata]]
 
** [[Text field]]
 
*** [[Name field]]
 
  
 
== Description ==
 
== Description ==
 +
This field can store the individual parts of a person's name.  Including family name(s) (a.k.a. surname) given name(s) (or initials), honorific (e.g. Dr, Prof, etc.) and lineage (e.g. Jr, Sr, III, etc.) 
  
== Properties ==
+
The configuration for this field provides various customisations that determine which and what order these sub-fields can be entered and/or rendered.
  
As for [[text field]]s with the following differences...
+
== Inheritance ==
 +
* [[Metadata]]
 +
** [[Multipart field]]
 +
*** [[Name field]]
 +
 
 +
== Additional Properties ==
 +
As for [[Multipart field#Additional Properties|Multipart fields]] except for:
  
 
{| border="1" cellpadding="3" cellspacing="0"
 
{| border="1" cellpadding="3" cellspacing="0"
| name || default || description
+
! Name !! Default Value !! Required !! Description !! Notes
 
|-
 
|-
| '''family_first''' || n/a || '''This property is taken from the repository configuration.''' Determines the input order: when 1 then the first box asks the family name, and the second the given name. The default is 0.
+
| '''family_first''' || <tt>0</tt> || NO || Determines the input order: when <tt>1</tt> then the first asks the family name, and then the given name. || The default is set in <tt>cfg.d/field_property_defaults.pl</tt>.
 
|-
 
|-
| '''hide_honourific''' || n/a || '''This property is taken from the repository configuration.''' For input: if 1 do not prompt for the title (Dr, Prof, Esq)
+
| '''hide_honourific''' || <tt>0</tt> || NO || Whether the honorific (e.g. Dr, Prof, Esq) sub-field should be displayed in the input form. || The default is set in <tt>cfg.d/field_property_defaults.pl</tt>.
 
|-
 
|-
| '''hide_lineage''' || n/a || '''This property is taken from the repository configuration.''' For input: if 1 do not prompt for lineage (Jr, III, IV)
+
| '''hide_lineage''' || <tt>1</tt> || NO || Whether the lineage (e.g. Jr, Sr, III, IV) sub-field should be displayed in the input form. || The default is set in <tt>cfg.d/field_property_defaults.pl</tt>.
 
|-
 
|-
| '''input_name_cols''' || n/a || '''This property is taken from the repository configuration.'''
+
| '''input_name_cols''' || <tt>{ honourific=>8, given=>20, family=>20, lineage=>8 }</tt> || NO || The widths of the text sub-fields in the input form. || The default is set in <tt>cfg.d/field_property_defaults.pl</tt>.
 
|-
 
|-
| '''render_order''' || fg || Output: f is for ''family'', g is for ''given''. The ''fg'' format is rendered as "Davis Jr, Dr Sammy" if both lineage and honourific is present; the ''gf'' order results in "Dr Sammy Davis Jr"
+
| '''render_dynamic''' || <tt>undef</tt> || NO || Whether names (e.g. creators) beyond <tt>render_limit</tt> can be unhidden in a citation.  || Only applicable if <tt>limit_names_shown</tt> is set as <tt>render_value</tt> for parent field (e.g. creators).
 +
|-
 +
| '''render_limit''' || <tt>undef</tt> || NO || Whether to limit and to how many names (e.g. creators) in a citation. || Only applicable if <tt>limit_names_shown</tt> is set as <tt>render_value</tt> for parent field (e.g. creators).
 +
|-
 +
| '''render_order''' || <tt>fg</tt> || NO || The order the given and family names should appear when rendered. || <tt>f</tt> is for ''family'', <tt>g</tt> is for ''given''. The <tt>fg</tt> format is rendered as <tt>Davis Jr, Dr Sammy</tt> if both lineage and honourific is present; the <tt>gf</tt> order results in <tt>Dr Sammy Davis Jr</tt>.
 +
|-
 +
| '''text_index''' || <tt>1</tt> || NO || Whether the text for these fields should be indexed. || Different from [[Metadata]] default (<tt>0</tt>).
 
|}
 
|}
  
 
== Required Phrases ==
 
== Required Phrases ==
 +
No additional phrases beyond those required for [[Multipart field#Required_Phrases|Multipart fields]].
 +
 +
== Database ==
 +
Name fields are stored in the database as
 +
fieldname_family VARCHAR(64)
 +
fieldname_given VARCHAR(64)
 +
fieldname_lineage VARCHAR(10)
 +
fieldname_honourific VARCHAR(10)
 +
 +
== API ==
 +
See [[API:EPrints/MetaField/Longtext|API page]].
 +
 +
== Examples ==
 +
Most basic example.
 +
{
 +
    name => 'name',
 +
    type => 'name',
 +
}
 +
Display given name before family name.
 +
{
 +
    name => 'name',
 +
    type => 'name',
 +
    render_order => 'gf',
 +
}
 +
Hide the honorific and lineage fields from entry and make family name the first field to be entered.
 +
{
 +
    name => 'name',
 +
    type => 'name',
 +
    hide_honourific => 1,
 +
    hide_lineage => 1,
 +
    family_first => 1,
 +
}
 +
Use as a sub-field (in a multiple field).
 +
{
 +
    name => 'creators',
 +
    type => 'compound',
 +
    multiple => 1,
 +
    fields => [
 +
        {
 +
            sub_name => 'name',
 +
            type => 'name',
 +
            hide_honourific => 1,
 +
            hide_lineage => 1,
 +
            family_first => 1,
 +
        },
 +
        {
 +
            sub_name => 'id',
 +
            type => 'text',
 +
            input_cols => 20,
 +
            allow_null => 1,
 +
            export_as_xml => 0,
 +
        }
 +
    ],
 +
    input_boxes => 4,
 +
}

Latest revision as of 08:04, 16 April 2023

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


Metadata Fields: Arclanguage - Base64 - Bigint - Boolean - Compound - Counter - Dataobjref - Date - Decimal - Email - Fields - Float - Id - Idci - Image - Int - Itemref - Keywords - Langid - Longtext - Longtext_counter - Multilang - Multipart - Name - Namedset - Pagerange - Recaptcha - Relation - Search - Secret - Set - Storable - Subject - Subobject - Text - Time - Timestamp - Url - Uuid


Description

This field can store the individual parts of a person's name. Including family name(s) (a.k.a. surname) given name(s) (or initials), honorific (e.g. Dr, Prof, etc.) and lineage (e.g. Jr, Sr, III, etc.)

The configuration for this field provides various customisations that determine which and what order these sub-fields can be entered and/or rendered.

Inheritance

Additional Properties

As for Multipart fields except for:

Name Default Value Required Description Notes
family_first 0 NO Determines the input order: when 1 then the first asks the family name, and then the given name. The default is set in cfg.d/field_property_defaults.pl.
hide_honourific 0 NO Whether the honorific (e.g. Dr, Prof, Esq) sub-field should be displayed in the input form. The default is set in cfg.d/field_property_defaults.pl.
hide_lineage 1 NO Whether the lineage (e.g. Jr, Sr, III, IV) sub-field should be displayed in the input form. The default is set in cfg.d/field_property_defaults.pl.
input_name_cols { honourific=>8, given=>20, family=>20, lineage=>8 } NO The widths of the text sub-fields in the input form. The default is set in cfg.d/field_property_defaults.pl.
render_dynamic undef NO Whether names (e.g. creators) beyond render_limit can be unhidden in a citation. Only applicable if limit_names_shown is set as render_value for parent field (e.g. creators).
render_limit undef NO Whether to limit and to how many names (e.g. creators) in a citation. Only applicable if limit_names_shown is set as render_value for parent field (e.g. creators).
render_order fg NO The order the given and family names should appear when rendered. f is for family, g is for given. The fg format is rendered as Davis Jr, Dr Sammy if both lineage and honourific is present; the gf order results in Dr Sammy Davis Jr.
text_index 1 NO Whether the text for these fields should be indexed. Different from Metadata default (0).

Required Phrases

No additional phrases beyond those required for Multipart fields.

Database

Name fields are stored in the database as

fieldname_family VARCHAR(64)
fieldname_given VARCHAR(64)
fieldname_lineage VARCHAR(10)
fieldname_honourific VARCHAR(10)

API

See API page.

Examples

Most basic example.

{
    name => 'name',
    type => 'name',
}

Display given name before family name.

{
    name => 'name',
    type => 'name',
    render_order => 'gf',
}

Hide the honorific and lineage fields from entry and make family name the first field to be entered.

{
    name => 'name',
    type => 'name',
    hide_honourific => 1,
    hide_lineage => 1,
    family_first => 1,
} 

Use as a sub-field (in a multiple field).

{
    name => 'creators',
    type => 'compound',
    multiple => 1,
    fields => [
        {
            sub_name => 'name',
            type => 'name',
            hide_honourific => 1,
            hide_lineage => 1,
            family_first => 1,
        },
        {
            sub_name => 'id',
            type => 'text',
            input_cols => 20,
            allow_null => 1,
            export_as_xml => 0,
        }
    ],
    input_boxes => 4,
}