Subject field: Difference between revisions
→Inheritance: Added Text and Id |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 13: | Line 13: | ||
== Additional Properties == | == Additional Properties == | ||
As for [[Set field#Additional_Properties|Set fields]] except for | As for [[Set field#Additional_Properties|Set fields]] except for | ||
{| border="1" cellpadding="3" cellspacing="0" | {| border="1" cellpadding="3" cellspacing="0" | ||
! Name !! Default Value !! Required !! Description !! Notes | |||
|- | |- | ||
| '''input_style''' || 0 || | | '''input_style''' || <tt>0</tt> || NO || How field is displayed in input form. || Different from [[Set field]] default. | ||
|- | |- | ||
| '''nestids''' || 1 || | | '''nestids''' || <tt>1</tt> || NO || Options are colon (<tt>:</tt>) separated path of sub-tree IDs rather than just the specific subject ID. | ||
|| Useful if subjects likely to appear at multiple positions in the tree. | |||
|- | |- | ||
| '''options''' || | | '''options''' || <tt>undef</tt> || NO || Options from which to choose. || NOT inherited from [[Set field]]. Options provided by subject sub-tree defined in <tt>top</tt>. | ||
|- | |- | ||
| ''' | | '''search_input_style''' || <tt>default</tt> || NO || How to display options in search form || Display options as <tt>select</tt> box rather than set of checkboxes. | ||
|- | |- | ||
| ''' | | '''showall''' || <tt>0</tt> || NO || Whether to show all options under <code>top</code>, not just those marked as <tt>depositable</tt>. || | ||
|- | |- | ||
| ''' | | '''showtop''' || <tt>0</tt> || NO || Whether to show the subject option defined by <code>top</code> as well as the subjects underneath. || | ||
|- | |||
| '''top''' || <tt>subjects</tt> || YES || Specifies the subject ID that is the root node of the sub-tree of the subjects to use as options. || | |||
|} | |} | ||
Latest revision as of 11:20, 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 - Recaptcha3 - Relation - Search - Secret - Set - Storable - Subject - Subobject - Text - Time - Timestamp - Url - Uuid
Description[edit]
This field is like a Set field but rather than explicitly defining its set of options within the field configuration, the field configuration attribute top specifies the root of the subjects sub-tree to use as a set of options.
Inheritance[edit]
Additional Properties[edit]
As for Set fields except for
| Name | Default Value | Required | Description | Notes |
|---|---|---|---|---|
| input_style | 0 | NO | How field is displayed in input form. | Different from Set field default. |
| nestids | 1 | NO | Options are colon (:) separated path of sub-tree IDs rather than just the specific subject ID. | Useful if subjects likely to appear at multiple positions in the tree. |
| options | undef | NO | Options from which to choose. | NOT inherited from Set field. Options provided by subject sub-tree defined in top. |
| search_input_style | default | NO | How to display options in search form | Display options as select box rather than set of checkboxes. |
| showall | 0 | NO | Whether to show all options under top, not just those marked as depositable. |
|
| showtop | 0 | NO | Whether to show the subject option defined by top as well as the subjects underneath. |
|
| top | subjects | YES | Specifies the subject ID that is the root node of the sub-tree of the subjects to use as options. |
Required Phrases[edit]
No additional phrases beyond those required for Set fields. Also, datasetid + "_fieldopt_" + fieldname + "_" + optionname phrases are not required, as these are taken from the name assigned to the subject.
Database[edit]
Namedset fields are stored in the database as
fieldname VARCHAR(255)
API[edit]
See API page.
Examples[edit]
Most basic example. Using divisions subjects tree sub-tree to provide options.
{
name => 'division',
type => 'subject',
top => 'divisions',
}
Allow multiple subject options to be selected.
{
name => 'subjects',
type => 'subject',
multiple => 1,
top => 'subjects',
}
Rendered value will link to corresponding listings page in subjects browse view.
{
name => 'subjects',
type => 'subject',
multiple => 1,
top => 'subjects',
browse_link => 'subjects',
}