EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #04789
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: citation modification
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: citation modification
- From: "Field A.N." <af05v@ecs.soton.ac.uk>
- Date: Fri, 25 Sep 2015 10:39:02 +0100
This is probably best accomplished with an output renderer on a field. In the field configuration, add the render_single_value property, something like this:
render_single_value => 'render_name_with_initials',
...then in a separate .pl file (e.g. z_render_name_with_initials.pl)
$c->{render_name_with_initials} = sub
{
my ($field, $repo, $value) = @_;
my $family = $value->{family};
my $given = $value->{given};
#now process as you like
$given = substr($given, 0, 1);
$name_string = $family . ', ' , $given;
return $repo->xml->create_text_node('$name_string);
}
As usual, this is typed into my browser with minimal testing. It probably won't compile.
--
Adam Field
Business Relationship Manager and Community Lead
EPrints Services
+44 (0)23 8059 8814
On 25 Sep 2015, at 10:19, Thomas Lauke wrote:
> Hi all,
>
> we would like to modify the default citation, i.e. imho the
> /opt/eprints3/Eprints/archives/repoID/cfg/citations/eprint/default.xml
> should look like
> <if test="is_set( creators )"><print expr="creators_name_family"/>, substr(<print expr="creators_name_given"/>,1,1).</if> ... but creators_name couldn't be modified this way :(
>
> How to modify the printing of editors_name as well?
> Where to put the multilanguage phrases to replace the concation by 'and' ...?
>
> Many thanks for any hint in advance
> Thomas
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
- References:
- [EP-tech] citation modification
- From: Thomas Lauke <th.lauke@arcor.de>
- [EP-tech] citation modification
- Prev by Date: [EP-tech] Re: Apache segfault
- Next by Date: [EP-tech] Re: Apache segfault
- Previous by thread: [EP-tech] citation modification
- Next by thread: [EP-tech] apt-get upgrade from 3.3.12 to 3.3.14 - apt notification remains
- Index(es):
