EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #05716
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] How to customize creators_name in citations
- To: eprints-tech@ecs.soton.ac.uk
- Subject: Re: [EP-tech] How to customize creators_name in citations
- From: Mathieu Perron <mathieu_perron@uqac.ca>
- Date: Tue, 17 May 2016 12:34:09 +0000 (UTC)
Adam Field <Adam.Field <at> jisc.ac.uk> writes: > > > The default rendering of names is with EPrints::Utils::make_name_string, which inserts the comma whether you like it or not. See: > > https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Utils.pm#L1 57 > > You will need a render method: > > $c->{render_family_name_first_no_comma} = sub > { > > my ($repo, $field, $value, $allangs, $nolink, $eprint) = <at> _; > > > #please make this a little more sophisticated -- there's currently no exception handling for missing values > > return $repo->xml->create_text_node($value->{family} . ' ' . $value-> {given}); > } > > ...and in the field definition: > > > > {name => 'creators',type => 'compound',multiple => 1,fields => [{sub_nam e => 'name',type => 'name',hide_honourific => 1,hide_lineage => 1,family _first => 1, > > render_single_value => 'render_family_name_first_no_comma',}, {sub_name => 'id',type => 'text',input_cols => 20,allow_null => 1,}],inp ut_boxes => 4, > }, > > > > -- > Adam Adam, I just tried your solution and it works like a charm! You are a life saver! Thank you for a fast and perfect solution! Have a nice day! Mathieu Perron
- References:
- [EP-tech] How to customize creators_name in citations
- From: Mathieu Perron <mathieu_perron@uqac.ca>
- Re: [EP-tech] How to customize creators_name in citations
- From: Adam Field <Adam.Field@jisc.ac.uk>
- [EP-tech] How to customize creators_name in citations
- Prev by Date: Re: [EP-tech] Notification of embargo release?
- Next by Date: [EP-tech] Antwort: Re: Problems with the Coversheets plugin
- Previous by thread: Re: [EP-tech] How to customize creators_name in citations
- Next by thread: [EP-tech] Event Queue question
- Index(es):