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
Template:EPrints Metadata Fields Content
(section)
Template
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!
=== Input and Validation Properties === {| cellpadding="3" cellspacing="0" border="1" ! Name !! Default Value !! Required !! Description !! Notes |- | '''default_value''' || <tt>undef</tt> || NO || The default value to set for this field. || This is mainly used for [[EPrints Glossary#System field|system fields]]. For custom fields it is better to use [[eprint_fields_default.pl]] or similar. |- | '''expanded_subjects''' || <tt>[]</tt> || NO || Subjects to show un-collapsed in the subject tree field in the workflow. || This is only applicable for [[Subject field]]s. All the fields listed will have their paths in the subject tree expanded so they can be seen, making them easier to find. |- | '''false_first''' || <tt>0</tt> || NO || Display the false option before the true option in the input form. || This is only applicable to [[Boolean field]]s. By default true option is always displayed before the false option. |- | '''fromform''' || <tt>undef</tt> || NO || The inverse of <tt>toform</tt>. This takes the value from the form and converts it into the value that will be stored in the database. || This function is passed the parameters: <tt>$value, $session, $object, $basename</tt> when <tt>$value</tt> is the value entered on the HTML form, and the return value is the value to be stored in the database. This function is not called when editing the eprint is cancelled. |- | '''get_item''' || <tt>undef</tt> || NO || A bespoke function for how to lookup the [[EPrints Glossary#Data object|Data object]] based on the stored value. || Only applicable to [[Itemref field]]s. |- | '''help_xhtml''' || <tt>undef</tt> || NO || An [[XHTML DOM]] object to use for the help text for this field. || This can only be set via the [[Workflow Format]] configuration not via the metadata field directly. This is so that the workflow can conditionally change the help on a field. If you need to change the help text based on the eprint type, then you can just create a bespoke phrase with the format <code>"eprint_fieldhelp_" + fieldname + "." + eprint_type</code> (e.g. <code>eprint_fieldhelp_id_number.article</code>). |- | '''input_add_boxes''' || <tt>2</tt> || NO || The number of rows to add when clicking the <tt>More input rows</tt> button for a field that sets <code>multiple => 1</code>. || The default value for this property is taken from <tt>cfg.d/[[field_property_defaults.pl]]</tt>. |- | '''input_boxes''' || <tt>3</tt> || NO || The number of input rows to initially show for a field that sets <code>multiple => 1</code>. || The default value for this property is taken from <tt>cfg.d/[[field_property_defaults.pl]]</tt>. |- | '''input_cols''' || <tt>60</tt> || NO || The number of columns in an HTML form field. || The default value for this property is taken from <tt>cfg.d/[[field_property_defaults.pl]]</tt>. This in combination with the <tt>maxlength</tt> property determines the value for <tt>size</tt> attribute for <code><input></code> HTML fields or the <tt>cols</tt> attribute for <code><textarea></code> HTML fields (used by [[Longtext field]]s). |- | '''input_lookup_params''' || <tt>undef</tt> || NO || Additional parameters to pass to the <tt>input_lookup_url</tt>. || E.g. an indication of which autocomplete file to use. |- | '''input_lookup_url''' || <tt>undef</tt> || NO || The URL to use for autocompletion. || This is generally set using the workflow configuration rather than directly in the field configuration. The URL must be on the same server hostname as the repository. |- | '''input_ordered''' || <tt>1</tt> || NO || Whether the ordering of values needs to be captured. || In some <code>multiple => 1</code> fields, such as creators, the order of the values is important and by default numbers are shown to the left of input rows and to the right are ''move up'' and ''move down'' arrows. However, with some <code>multiple => 1</code> fields the order is not important, in which case you can set this to <tt>0</tt> to stop the arrows and numbers being shown. |- | '''input_rows''' || <tt>10</tt> || NO || The number of rows in an HTML form field. || The default value for this property is taken from <tt>cfg.d/[[field_property_defaults.pl]]</tt> This property determines the value for <tt>size</tt> attribute for <code><select></code> HTML fields (used by [[Set field]]s) or the <tt>rows</tt> attribute for <code><textarea></code> HTML fields (used by [[Longtext field]]s). |- | '''maxlength''' || <tt>255</tt> || NO || The maximum allowed length in characters for a value. || This can be a very simple validation check. Also, it may confuse users to be allowed to type in 255 characters in a field intended for something like a postcode/zipcode. |- | '''maxwords''' || <tt>undef</tt> || NO || The maximum number of words that should be entered for this field. || This field is only applicable to [[Longtext_counter field]]s. It does not restrict the number of words, it just displays this limit next to a dynamic counter of the number of words already entered. |- | '''render_input''' || <tt>undef</tt> || NO || The name of a function which will render the input for this field. || This can be difficult to use as it must return the same CGI parameters as the default input form would have. It is easiest on simple fields. The subroutine is passed the following parameters: <code>$field, $session, $current_value, $dataset, $staff, $hidden_fields, $object, $basename</code> ). It should return the [[XHTML DOM]] object of the chunk of HTML form. |- | '''required''' || <tt>0</tt> || NO || Whether the field must have a value set. || If this is set to <tt>1</tt> then the field is always marked as required, no matter what the [[Workflow Format]] configuration says. |- | '''separator''' || <tt>undef</tt> || NO || What character to use to separate elements of the value for the field for purposes of search || Only used by default for [[Keywords field]]s. |- | '''show_help''' || <tt>undef</tt> || NO || How to display the help text for this field in the input form. || Can be one of three values: <tt>always</tt>, <tt>never</tt> or <tt>toggle</tt>. Toggle (allow to expand or collapse) is used if not explicitly defined. This can only be overridden in [[Workflow Format]] configuration. |- | '''title_xhtml''' || <tt>undef</tt> || NO || An [[XHTML DOM]] object to use for the title for this field. || This can only be set via the [[Workflow Format]] configuration not via the metadata field directly. This is so that the workflow can conditionally change the title of a field. If you need to change the title based on the eprint type, then you can just create a bespoke phrase with the format <code>"eprint_fieldname_" + fieldname + "." + eprint_type</code> (e.g. <code>eprint_fieldname_id_number.article</code>). |- | '''toform''' || <tt>undef</tt> || NO || This function is allowed to modify the current value which appears in the form. || E.g. if your database stores <tt>userid</tt>s in a field, but you want to allow people to edit them as <tt>username</tt>s, then this function can be used to take the current value (a <tt>userid</tt>) and return the associated <tt>username</tt>. This value is what appears in the field in the search form. It is passed: <code>$value, $session, $object, $basename</code> and returns the user-facing version of <code>$value</code>. |}
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)