EPrints Technical Mailing List Archive
Message: #04929
< 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: Adam Field <af05v@ecs.soton.ac.uk>
- Date: Tue, 13 Oct 2015 15:29:31 +0100
Ah, it's a compound multiple field. You need to render creators_name, not creators. Also, try putting the render_single_value in the name subfield definition -- I'm not sure if it will work off the top of my head, but it makes sense. I've modified the code below. Let us know if it works. I modified eprint_fields.pl: { name => 'creators', type => 'compound', multiple => 1, fields => [ { sub_name => 'name', type => 'name', hide_honourific => 1, hide_lineage => 1, family_first => 1, render_single_value => 'render_name_with_initials', }, { sub_name => 'id', type => 'text', input_cols => 20, allow_null => 1, } ], input_boxes => 2, }, I introduced eprint_render_single.pl: print STDERR "It's Me :)\n"; $c->{render_name_with_initials} = sub { print STDERR "It's You :)\n"; my( $field, $repo, $value ) = @_; my $family = $value->{family}; my $given = $value->{given}; return $repo->xml->create_text_node( 'foo' ); } I used Test.pl #!/usr/bin/perl -I/opt/eprints3/perl_lib use strict; use warnings; use EPrints; my $ep = EPrints->new; my $repo = $ep->repository('b40literatur'); my $eprint = $repo->dataset('eprint')->dataobj(3); print STDERR EPrints::Utils::tree_to_utf8($eprint->render_value('creators_name')); -- Adam Field Business Relationship Manager and Community Lead EPrints Services On 13 Oct 2015, at 15:09, Thomas Lauke <th.lauke@arcor.de> wrote: Hi Adam, |
- References:
- [EP-tech] Re: citation modification
- From: Thomas Lauke <th.lauke@arcor.de>
- [EP-tech] Re: citation modification
- Prev by Date: [EP-tech] Re: citation modification
- Next by Date: [EP-tech] Re: citation modification
- Previous by thread: [EP-tech] Re: citation modification
- Next by thread: [EP-tech] Re: citation modification
- Index(es):