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
Adding multilang fields
(section)
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!
== How to add a custom, multilingual field == Replacing an EPrints basic field, like the '''title''' field, involves a few steps. First, a new field needs to be created that will be able to store information for different languages; this field will be of type '''multilang'''. Next, the basic field's type needs to be replaced with one that is able to use our newly created field as its storage place. This field type will use a function wrapper for storing and retrieving information from the '''multilang''' field, hence the '''title''' field will become a calculated field. So, in order to add multilingual support for the '''title''' field, the following actions need to take place: * A ''new field type needs to be created'' that will help our '''title''' field to implement some of EPrints logic. Our field type is called '''virtualwithvalue'''. * A ''new '''multilang''' field needs to be created'' that will store our multilingual information. We will call this field '''ml_title'''. * '''''ml_title''' field and '''title''' field's functionality need to be introduced to the EPrints system'' via a configuration file located in '''~eprints/archives/<reponame>/cfg/cfg.d/'''. * ''EPrints' database needs to be updated'' to include the new field. * ''The appropriate phrases need to be added'' for the '''ml_title''' field on each supported language. * ''The '''title''' field needs to be replaced'' with '''ml_title''' field in the workflow. * '''''ml_title''' field in the workflow will needs a custom lookup script''. * ''The '''title''' field needs to be replaced with the '''ml_title''' field in the simple and advanced search scripts''. * The ''repository needs to be reloaded''. * ''Static files need to be regenerated'' if our repository already contains data. The following sections explain each step in detail, and ''title''' and '''ml_title''' are used as our example fields. The code snippets are just for demonstration purposes - and proof of concept. If you want to see the final, working implementation, you should look at the source code of the [[MultiLang_Fields_Bazaar_Package]] plugin.
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)