Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
Set field
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{fieldtypes}} == Description == Allows a set of options to be specified using the <code>options</code> attribute of the field's configuration. The set of options is then displayed in one of several different forms: * radio buttons if <code>input_style => 'long'</code> or <code>input_style => 'medium'</code> and <code>multiple => 0</code>. * check boxes if <code>input_style => 'long'</code> or <code>input_style => 'medium'</code> and <code>multiple => 1</code>. * select box if <code>input_style => 'short'</code>. When <code>input_style => 'long'</code> is used both names and descriptions for each option will be displayed with radio buttons / check boxes. For <code>input_style => 'medium'</code> only names are displayed. == Inheritance == * [[Metadata]] ** [[Id field]] *** [[Text field]] **** [[Set field]] == Additional Properties == As for [[Text field#Additional_Properties|Text fields]] except for {| border="1" cellpadding="3" cellspacing="0" ! Name !! Default Value !! Required !! Description !! Notes |- | '''form_input_style''' || <tt>select</tt> || NO || How to present options in the input form. || Only applicable when <tt>input_style => 'short'</tt>. Any value other than <tt>checkbox</tt> will display as <tt>select</tt> box rather than individual checkboxes. <tt>checkbox</tt> should only be used if <tt>multiple => 1</tt> |- | '''input_ordered''' || <tt>0</tt> || NO || If multiple values should they be submitted in a specific order || Different from [[Metadata]] default. Only applicable if <tt>multiple => 1</tt>. Not normally useful for Set fields as ordering better determined by ordering of <tt>options</tt>. |- | '''input_rows''' || <tt>10</tt> || NO || Number of rows (i.e. options) to display in select box for input form . || The default value for this property is taken from <tt>cfg.d/field_property_defaults.pl</tt>. Only applicable if <tt>input_style => 'short'</tt>. |- | '''input_style''' || <tt>short</tt> || NO || How field is displayed in input form. || Can be one of <tt>short</tt>, <tt>medium</tt> or <tt>long</tt>. |- | '''input_tags''' || <tt>undef</tt> || NO || Use alternative tags for options in input form. || If defined must be a function that generates an array of tags. If not defined, tags will be the same as options. Useful if you want to sub-divide sections of options. |- | '''match''' || <tt>EQ</tt> || NO || How to match values in search results. || Different from [[Text field]] default (<tt>IN</tt>). Treat the search value as a single string rather than a whitespace-separated list of words. |- | '''merge''' || <tt>ANY</tt> || NO || Initial search form setting for whether to match on all or any values (i.e. options). || Different from [[Metadata]] default (<tt>ALL</tt>). |- | '''order_labels''' || <tt>0</tt> || NO || Whether to re-order input/search form options based on their labels (e.g. phrase names). || |- | '''options''' || n/a || YES || Options to present in input form. || |- | '''render_max_search_values''' || <tt>5</tt> || NO || Maximum number of options displayed in search description title of search results. || |- | '''render_option''' || <tt>undef</tt> || NO || How to render individual options. || If defined must be a function that generates output to be rendered for a single option. If not <tt>datasetid + "_fieldopt_" + fieldname + "_" + optionname</tt> phrase will be used. |- | '''search_input_style''' || <tt>checkbox</tt> || NO || How to present options in search form. || Either checkboxes by default or select box if any other value set. |- | '''search_rows''' || <tt>12</tt> || NO || Number of rows (i.e. options_ to display in search form. || Only applicable if <tt>search_input_style</tt> set to something other than <tt>checkbox</tt>. |- | '''sql_index''' || <tt>1</tt> || NO || Whether field should be index for quicker lookup by the database. || Different from [[Text field]] default (<tt>0</tt>). |- |} == Required Phrases == In addition to the [[Metadata#Required_Phrases|standard metadata field phrases]], if <code>input_style => 'short'</code> or <code>input_style => 'medium'</code> then the only extra phrases required are the name label for each of the options in the form: datasetid + "_fieldopt_" + fieldname + "_" + optionname E.g. <tt>eprint_fieldopt_ispublished_unpub</tt> If <code>input_style => 'long'</code> then further phrases are required to provide descriptions for each option, in the form: datasetid + "_optdetails_" + fieldname + "_" + optionname E.g. <tt>eprint_optdetails_type_book</tt> == Database == Set fields are stored in the database as fieldname VARCHAR(255) == API == See [[API:EPrints/MetaField/Set|API page]]. == Examples == Most basic example. (Provides options in a select box). { name => 'pedagogic_type', type => 'set', options => [qw( presentation activity case enquiry problem collaboration communication )], } Provide options as radio buttons. { name => 'event_type', type => 'set', options => [qw( conference workshop other )], input_style => 'medium', } Provide options as check boxes. { name => 'availability', multiple => 1, type => 'set', options => [qw( print electronic )], input_style => 'medium', } Provide search form options as select box (rather than check boxes). { name => 'pedagogic_type', type => 'set', options => [qw( presentation activity case enquiry problem collaboration communication )], search_input_style => 'short', }
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Fieldtypes
(
edit
)
Template:RefLinks
(
edit
)