[EP-tech] Render_value help

Jean-Marie.Lebechec at inp-toulouse.fr Jean-Marie.Lebechec at inp-toulouse.fr
Tue Oct 24 15:07:31 BST 2017


Hi all,

I want to modify the rendering field creators to add an ID ("ppn") as 
indicated in this page. So I defined in my eprint_field.pl this 
configuration:

/{
             'name' => 'creators',
             'type' => 'compound',
             'allow_null' => 1,
             'multiple' => 1,
             'fields' => [
                           {
                             'sub_name' => 'ppn',
                             'type' => 'text',
                             'input_cols' => 10,
                             'allow_null' => 1,
                           },
                           {
                             'sub_name' => 'name',
                             'type' => 'name',
                             'hide_honourific' => 1,
                             'hide_lineage' => 1,
                             'family_first' => 1,
                             },
                           },
                           {
                             'sub_name' => 'id',
                             'type' => 'text',
                             'input_cols' => 20,
                             'allow_null' => 1,
                           },
                         ],
                         'input_boxes' => 4,
                          'render_value' => 'idref',
.../

/}/


but I can not write the code to display the authors' data in the 
following form:
"Name, First name (ppn) and  Name, First name and Name, First name 
(ppn)" for example.

I started writing things like this:
/$c->{idref} = sub
{

my ($repo, $field, $value, $allangs, $nolink, $eprint) = @_;
my @authors;

for( @{ $eprint->value( "creators" ) } )
{

       push @authors, {
         author => EPrints::Utils::make_name_string( $_->{name} ),
       };
return \@authors;
}

}/

but it does not work....

Any help or example will be welcome!

Jean-Marie


-- 

***********************************************
Jean Marie Le Bechec
Service Commun de la Documentation
Responsable ingenierie documentaire
&
Direction du Systeme d'Information
Referent Etudes

Institut National Polytechnique de Toulouse
6 allee Emile Monso - bp 34038 -
31029 Toulouse cedex 4
Tel : 05 34 32 31 16
Tel Port : 06 40 81 35 68
Mail :lebechec at inp-toulouse.fr
***********************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20171024/a8f9ef43/attachment-0001.html 


More information about the Eprints-tech mailing list