EPrints Technical Mailing List Archive

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


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/