Difference between revisions of "Removing Unspecified"

From EPrints Documentation
Jump to: navigation, search
(Created page with 'In EPrints when a field has a multiple choice set of values their is always an Unspecified value by default. Unspecified exists because their needs to be a mechanism in the inter…')
 
Line 2: Line 2:
  
 
A couple of solutions exist:
 
A couple of solutions exist:
 +
 +
==Make the field required==
 
My old personal favourite was to make the field "required" in the workflow by adding <code>required="yes"</code> to the workflow element:
 
My old personal favourite was to make the field "required" in the workflow by adding <code>required="yes"</code> to the workflow element:
 
  <field ref="copyright" required='yes' />
 
  <field ref="copyright" required='yes' />
 
Because you must have a value for this field in order to move to the next stage of the workflow Unspecified is removed.  
 
Because you must have a value for this field in order to move to the next stage of the workflow Unspecified is removed.  
 
How ever this solution comes with its own problems. Because its a required field the input is now has a red star next to it. This alerts attention to the field and often confuses the users because they dont understand why the field is required. Also if you havent set a default value for the field and the user choses not to fill it then the workflow will shout at them and not let them deposit the item untill they have made a choice.
 
How ever this solution comes with its own problems. Because its a required field the input is now has a red star next to it. This alerts attention to the field and often confuses the users because they dont understand why the field is required. Also if you havent set a default value for the field and the user choses not to fill it then the workflow will shout at them and not let them deposit the item untill they have made a choice.
 +
 +
==Change the phrase which the field is using==
 +
A much nicer but harder to find solution is to change the Unspecified phrase. Note it is a bad idea to change the "lib/metafield:unspeficied" because this changes the Unspecified phrase for every field. Since it crops up in lots of places you can't easily predict where users will see the phrase. However there is a field specific "Unspecified" which you can set. For sets and namedsets this takes the form of a string <dataset>_fieldopt_<fieldname>_
 +
  <epp:phrase id="eprint_fieldopt_course_information_course_code_">Please select...</epp:phrase>
 +
Changes Unspecified for the eprint field course_information_cource_code to Please select...

Revision as of 16:05, 14 July 2010

In EPrints when a field has a multiple choice set of values their is always an Unspecified value by default. Unspecified exists because their needs to be a mechanism in the interface way to not fill in an answer. This can often cause a lot of grief because "Unspecified" is not a very helpful term and it also looks plug ugly in your interface.

A couple of solutions exist:

Make the field required

My old personal favourite was to make the field "required" in the workflow by adding required="yes" to the workflow element:

<field ref="copyright" required='yes' />

Because you must have a value for this field in order to move to the next stage of the workflow Unspecified is removed. How ever this solution comes with its own problems. Because its a required field the input is now has a red star next to it. This alerts attention to the field and often confuses the users because they dont understand why the field is required. Also if you havent set a default value for the field and the user choses not to fill it then the workflow will shout at them and not let them deposit the item untill they have made a choice.

Change the phrase which the field is using

A much nicer but harder to find solution is to change the Unspecified phrase. Note it is a bad idea to change the "lib/metafield:unspeficied" because this changes the Unspecified phrase for every field. Since it crops up in lots of places you can't easily predict where users will see the phrase. However there is a field specific "Unspecified" which you can set. For sets and namedsets this takes the form of a string <dataset>_fieldopt_<fieldname>_

 <epp:phrase id="eprint_fieldopt_course_information_course_code_">Please select...</epp:phrase>

Changes Unspecified for the eprint field course_information_cource_code to Please select...