<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Title content=""><meta name=Keywords content=""><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Courier New";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Courier;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>You need to return a dom object from a render function. Here are a couple of replacement lines:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'> ….<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'> push @authors, </span><i><span lang=EN style='font-size:11.0pt;font-family:Calibri'>EPrints::Utils::make_name_string( $_->{name} );</span></i><span style='font-size:11.0pt;font-family:Calibri'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'> …<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'> return $repo->xml->create_text_node(join(‘; ‘, @authors));<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>Move the return to the bottom of the function, aswell. At the moment it’s in the loop. Also, I think your render_value config line may belong outside the fields section.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>--<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>Adam<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:Calibri;color:black'>From: </span></b><span style='font-family:Calibri;color:black'><eprints-tech-bounces@ecs.soton.ac.uk> on behalf of <Jean-Marie.Lebechec@inp-toulouse.fr><br><b>Reply-To: </b><eprints-tech@ecs.soton.ac.uk><br><b>Date: </b>Tuesday, 24 October 2017 15:07<br><b>To: </b><eprints-tech@ecs.soton.ac.uk><br><b>Subject: </b>[EP-tech] Render_value help<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p></div><p class=MsoNormal style='margin-left:36.0pt'>Hi all, <o:p></o:p></p><div><p style='margin-left:36.0pt'><span lang=EN>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:</span><o:p></o:p></p><p style='margin-left:36.0pt'><i><span lang=EN>{<br> 'name' => 'creators',<br> 'type' => 'compound',<br> 'allow_null' => 1,<br> 'multiple' => 1,<br> 'fields' => [<br> {<br> 'sub_name' => 'ppn',<br> 'type' => 'text',<br> 'input_cols' => 10,<br> 'allow_null' => 1,<br> },<br> {<br> 'sub_name' => 'name',<br> 'type' => 'name',<br> 'hide_honourific' => 1,<br> 'hide_lineage' => 1,<br> 'family_first' => 1,<br> },<br> },<br> {<br> 'sub_name' => 'id',<br> 'type' => 'text',<br> 'input_cols' => 20,<br> 'allow_null' => 1,<br> },<br> ],<br> 'input_boxes' => 4,<br> 'render_value' => 'idref',<br>...</span></i><o:p></o:p></p><p style='margin-left:36.0pt'><i><span lang=EN>}</span></i><o:p></o:p></p><p style='margin-left:36.0pt'><br><span lang=EN>but I can not write the code to display the authors' data in the following form:<br>"Name, First name (ppn) and Name, First name and Name, First name (ppn)" for example.</span><o:p></o:p></p><p style='margin-left:36.0pt'><span lang=EN>I started writing things like this:<br><i>$c->{idref} = sub<br>{<br><br>my ($repo, $field, $value, $allangs, $nolink, $eprint) = @_;<br>my @authors;<br><br>for( @{ $eprint->value( "creators" ) } )<br>{<br><br> push @authors, {<br> author => EPrints::Utils::make_name_string( $_->{name} ),<br> };<br>return \@authors;<br>}<br><br>}</i><br><br>but it does not work....<br><br>Any help or example will be welcome!</span><o:p></o:p></p><p style='margin-left:36.0pt'><span lang=EN>Jean-Marie<br><br></span><o:p></o:p></p><p style='margin-left:36.0pt'><o:p> </o:p></p><pre style='margin-left:36.0pt'>-- <o:p></o:p></pre><pre style='margin-left:36.0pt'><o:p> </o:p></pre><pre style='margin-left:36.0pt'>***********************************************<o:p></o:p></pre><pre style='margin-left:36.0pt'>Jean Marie Le Bechec<o:p></o:p></pre><pre style='margin-left:36.0pt'>Service Commun de la Documentation<o:p></o:p></pre><pre style='margin-left:36.0pt'>Responsable ingenierie documentaire<o:p></o:p></pre><pre style='margin-left:36.0pt'>&<o:p></o:p></pre><pre style='margin-left:36.0pt'>Direction du Systeme d'Information<o:p></o:p></pre><pre style='margin-left:36.0pt'>Referent Etudes<o:p></o:p></pre><pre style='margin-left:36.0pt'><o:p> </o:p></pre><pre style='margin-left:36.0pt'>Institut National Polytechnique de Toulouse<o:p></o:p></pre><pre style='margin-left:36.0pt'>6 allee Emile Monso - bp 34038 -<o:p></o:p></pre><pre style='margin-left:36.0pt'>31029 Toulouse cedex 4<o:p></o:p></pre><pre style='margin-left:36.0pt'>Tel : 05 34 32 31 16<o:p></o:p></pre><pre style='margin-left:36.0pt'>Tel Port : 06 40 81 35 68<o:p></o:p></pre><pre style='margin-left:36.0pt'>Mail : <a href="mailto:lebechec@inp-toulouse.fr">lebechec@inp-toulouse.fr</a><o:p></o:p></pre><pre style='margin-left:36.0pt'>*********************************************** <o:p></o:p></pre></div><p class=MsoNormal style='margin-left:36.0pt'>*** 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/ *** EPrints developers Forum: http://forum.eprints.org/ <o:p></o:p></p></div></body></html>