EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #06897


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Render_value help


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@inp-toulouse.fr
***********************************************