[EP-tech] Re: using a creator's inital in a citation

Florian Heß hess at ub.uni-heidelberg.de
Thu Mar 15 08:26:17 GMT 2012


Am 14.03.2012 17:06, schrieb John Salter:
> In another file (my_lovely_creator_rendered.pl?):
> $c->{my_lovely_creator_renderer} = sub {
> my( $session , $field , $value ) = @_;
> my $frag = $session->make_doc_fragment;
> #do some perl magic to return the value how you want it
> return $frag;
> };

At least for the fromform Parameter I managed to define a subroutine at 
the top of the very same file eprint_fields.pl with

my $compound_checkbox_cleaner = sub { ... };

$c->{fields}->{eprint} = [
     { name => 'some_custom_field',
       ...
       fromform => $compound_checkbox_cleaner,
       # or just fromform => sub {...}, if you need not to
       # reuse it for other fields
     }
];

Thus it cannot happen that you accidentally overwrite an $c->{whatever} 
entry, as your subroutine is just a private variable within 
eprint_fields.pl. There is a chance that works for render_value, too. 
Didn't test it, so try yourself if you want.


Regards,
F Heß

> Cheers,
> John
>
> ------------------------------------------------------------------------
> *From:* eprints-tech-bounces at ecs.soton.ac.uk
> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] *On Behalf Of *Chris Keene
> *Sent:* 14 March 2012 14:40
> *To:* eprints-tech at ecs.soton.ac.uk
> *Subject:* [EP-tech] using a creator's inital in a citation
>
> Hi
>
> We are currently reviewing how we add author names in to the creators
> fields of eprints, e.g. do we use the same format as the official
> source, do we use full names, or surname and initial.
>
> I’d like to know if it is possible to configure a eprints citation /
> view so that it only shows an initial for the forename, even if the
> field itself contains a full version of the forename?
>
> This would allow us to store the full name where we have it, while
> showing a consistent citation style of author names on the public site.
>
> Many thanks for any tips
>
> Chris
>
> Chris Keene
> Technical Development Manager, University of Sussex Library
> Contact: http://www.sussex.ac.uk/profiles/150000
>
>
>
> *** 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/


-- 
UB Heidelberg (Altstadt)
Plöck 107-109, 69117 HD
- Informationstechnik
- WWW-Redaktion
Tel. 06221 / 54 3550
http://www.ub.uni-heidelberg.de/



More information about the Eprints-tech mailing list