|
|
Line 13: |
Line 13: |
| { name => "groups", type=>"subject", top=>"groups", multiple => 1, | | { name => "groups", type=>"subject", top=>"groups", multiple => 1, |
| browse_link => "groups", | | browse_link => "groups", |
− | render_input=>\&EPrints::Extras::subject_browser_input }, | + | render_input=>\ |
− | | |
− | for reference, that all means
| |
− | name = id of the field
| |
− | type = type (heirarchical subject)
| |
− | multiple = you can select more than one value at once
| |
− | top = the top node in the tree
| |
− | render_input = use the clever subject input, rather than just a big pull-down menu
| |
− | browse_link = link values in this to pages in /view/groups/ (which we'll make in a minute)
| |
− | | |
− | Now run erase_archive & create_tables (assuming you've no live data, otherwise it's a bit harder). You may also need to run import_subjects and the other scripts mentioned in the [[http://www.eprints.org/documentation/tech/php/installation.php#creating_the_database_tables_and_website_ 'creating an archive']] documentation.
| |
− | | |
− | 3.
| |
− | add a human readable description for it:
| |
− | edit phrases-en.xml
| |
− | <ep:phrase ref="eprint_fieldname_groups">Groups</ep:phrase>
| |
− | <ep:phrase ref="eprint_fieldhelp_groups">add some relevant help for selecting groups here!</ep:phrase>
| |
− | <ep:phrase ref="metapage_title_groups">Groups</ep:phrase>
| |
− | <ep:phrase ref="viewname_eprint_groups">Groups</ep:phrase>
| |
− | | |
− | (the 3rd one is the title for the page on the input form, also called "groups", the 4th is the name which appears on the /view/ pages)
| |
− | | |
− | 4.
| |
− | add the field to each type of eprint
| |
− | edit metadata-types.xml
| |
− | each time you find
| |
− |
| |
− | <page name="subjects" />
| |
− | <field name="subjects" required="yes" />
| |
− | | |
− | | |
− | add below or before, which ever you prefer,
| |
− |
| |
− | <page name="groups" />
| |
− | <field name="groups" required="yes" />
| |
− | | |
− | 5.
| |
− | add it to the "abstract" pages:
| |
− | edit ArchiveRenderConfig.pm
| |
− | find:
| |
− | | |
− | # Subjects...
| |
− | $table->appendChild( _render_row(
| |
− | $session,
| |
− | $session->html_phrase( "eprint_fieldname_subjects" ),
| |
− | $eprint->render_value( "subjects" ) ) );
| |
− | | |
− | | |
− | add below or above or nearby:
| |
− | | |
− | | |
− | # Groups...
| |
− | $table->appendChild( _render_row(
| |
− | $session,
| |
− | $session->html_phrase( "eprint_fieldname_groups" ),
| |
− | $eprint->render_value( "groups" ) ) );
| |
− | | |
− | 6.
| |
− | add it to the browse /view/ section:
| |
− | Edit ArchiveConfig.pm
| |
− | Add:
| |
− | { id=>"groups", fields=>"groups", order=>"-date_effective/title", hideempty=>1 }
| |