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
ORCID
(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!
== Rendering the ORCID in a citation == The rendering of this field then needs to be changed to accommodate an author with an ORCID. The following script adds methods that can be called via the EPScript language: <source lang="perl"> # add to e.g. ~/archives/ARCHIVEID/cfg/cfg.d/z_add_to_EPrints_Script_Compiled.pl # Write into EPrints::Script::Compiled package to allow use of function in epscript { package EPrints::Script::Compiled; use strict; sub run_wrro_people_with_orcids { my( $self, $state, $value ) = @_; my $session = $state->{session}; my $r = $state->{session}->make_doc_fragment; my $creators = $value->[0]; foreach my $i (0..$#$creators){ my $creator = @$creators[$i]; if( $i > 0 ){ #not first item (or only one item) if( $i == $#$creators ){ #last item $r->appendChild( $session->make_text( " and " ) ); } else { $r->appendChild( $session->make_text( ", " ) ); } } my $person_span = $session->make_element( "span", "class" => "person" ); $person_span->appendChild( $session->render_name( $creator->{name} ) ); my $id = $creator->{id}; if( defined $id && $id =~ m/^(?:orcid.org\/)?(\d{4}\-\d{4}\-\d{4}\-\d{3}(?:\d|X))$/ ) { my $orcid_span = $session->make_element( "span", "class" => "orcid" ); # According to https://orcid.org/trademark-and-id-display-guidelines # "recommended display is a hyperlinked URI preceded by the iD icon" # This looks terrible in a citation. Removed for the time being. # # my $orcid_link = $session->make_element( # "a", # "href" => "http://orcid.org/", # "target" => "_blank", # "class" => "orcid-icon" # ); # $orcid_link->appendChild( $session->make_element( # "img", # "src" => "/images/orcid_16x16.png", # "title" => "ORCID" # ) ); # $orcid_span->appendChild( $orcid_link ); my $link = $session->make_element( "a", "href" => "http://orcid.org/$1", "target" => "_blank", ); $link->appendChild( $session->make_text( "orcid.org/$1" ) ); $orcid_span->appendChild( $session->make_text( "(" ) ); $orcid_span->appendChild( $link ); $orcid_span->appendChild( $session->make_text( ")" ) ); $person_span->appendChild( $session->make_text( " " ) ); $person_span->appendChild( $orcid_span ); } $r->appendChild( $person_span ); } return [ $r, "XHTML" ]; } } # END EPrints::Script::Compiled additions </source> You may also want a bit of CSS to style ORCID links <source lang="css"> /* Add to e.g. ~/archives/ARCHIVEID/cfg/static/style/auto/zzz_orcid.css */ .person:hover {border-bottom: 1px dashed #a6ce39;} .orcid {} .orcid a:hover { color: #a6ce39; } .orcid-icon {} .orcid-icon img { vertical-align: text-bottom; margin: 0 4px 0 2px; } </source> And finally, you have to call the new EPScript function from a citation file e.g. <code>archives/ARCHIVEID/cfg/citations/eprint/default.xml</code> <source lang="xml"> <!-- replace reference to e.g. <print expr="creators_name"/> with this: --> <print expr="wrro_people_with_orcids(creators)" /> </source>
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)