<div dir="ltr"><div><div><div><div><div>Dear all,<br><br></div>this is how I've solved the issue, and I hope I'll help somebody else too. This is my eprint citation:<br><br><?xml version="1.0" ?><br> <cite:citation xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" xmlns:cite="<a href="http://eprints.org/ep3/citation">http://eprints.org/ep3/citation</a>" xmlns:epc="<a href="http://eprints.org/ep3/control">http://eprints.org/ep3/control</a>"><br> <epc:set name='docs' expr='$item.original_documents()'><br> <epc:if test="length($docs) gt 0"><br> <epc:foreach expr="$docs" iterator="doc" limit="1"><br> <div class="col-md-3"><br> <div class="thumbnail"><br> <epc:set name='covers' expr='$item.cover_image()'><br> <epc:if test="length($covers) gt 0"><br> <epc:foreach expr="$covers" iterator="cover" limit="1"><br> <cite:linkhere><img src="{$cover.thumbnail_url('medium')}" class="img-rounded img-responsive" /> </cite:linkhere><br> </epc:foreach><br> </epc:if><br> <epc:if test="length($covers) gt 0"><br> <cite:linkhere><img src="{$doc.thumbnail_url('medium')}" class="img-rounded img-responsive" /> </cite:linkhere><br> </epc:if><br> </epc:set><br> <div class="caption"><br> <epc:choose><br> <epc:when test="type = 'article'"> <i class="fa fa-paperclip" aria-hidden="true"> Document </i> </epc:when><br> <epc:when test="type = 'audio'"> <i class="fa fa-music" aria-hidden="true"> Audio</i> </epc:when><br> <epc:when test="type = 'book'"> <i class="fa fa-book" aria-hidden="true"> Book</i> </epc:when><br> <epc:when test="type = 'image'"> <i class="fa fa-picture-o" aria-hidden="true"> Image</i> </epc:when><br> <epc:when test="type = 'video'"> <i class="fa fa-video-camera" aria-hidden="true"> Video</i> </epc:when><br> <epc:otherwise> <i class="fa fa-file-archive-o" aria-hidden="true"> Archive </i> </epc:otherwise><br> </epc:choose><br> <epc:choose><br> <epc:when test="strlen(title) gt 80"><br> <h3><cite:linkhere><epc:print expr="substr(title,0,70)" />...</cite:linkhere></h3> </epc:when><br> <epc:otherwise><br> <h3><cite:linkhere><epc:print expr="title" /></cite:linkhere></h3> </epc:otherwise><br> </epc:choose><br> <epc:if test="is_set(date)"><br> <epc:print expr="substr(date.as_string(),0,4)" /></epc:if><br> <epc:if test="is_set(creators_name)"><br> <epc:choose><br> <epc:when test="length(creators_name) gt 0"><br> <epc:set name="creators" expr="creators_name" limit="1"><br> <epc:foreach expr="$creators" iterator="creator"><br> <epc:print expr="$creator" /> </epc:foreach><br> </epc:set><br> </epc:when><br> </epc:choose><br> </epc:if><br> </div><br> </div><br> </div><br> </epc:foreach><br> </epc:if><br> </epc:set><br> </cite:citation><br><br><br></div>as you can see I use two procedures, that I created in <a href="http://document_fields.pl">document_fields.pl</a><br><br>{<br>package EPrints::Script::Compiled;<br><br> sub run_original_documents {<br> my( $self, $state, $eprint ) = @_;<br> if( ! $eprint->[0]->isa( "EPrints::DataObj::EPrint") ) {<br> $self->runtime_error( "documents() must be called on an eprint object." );<br> }<br> return [ [grep { $_->is_set( "content" ) && $_->value( "content" ) eq "original" } $eprint->[0]->get_all_documents()], "ARRAY" ];<br> };<br> sub run_cover_image {<br> my( $self, $state, $eprint ) = @_;<br> if( ! $eprint->[0]->isa( "EPrints::DataObj::EPrint") ) {<br> $self->runtime_error( "cover_image() must be called on an eprint object." );<br> }<br> return [ [grep { $_->is_set( "content" ) && $_->value( "content" ) eq "coverimage" } $eprint->[0]->get_all_documents()], "ARRAY" ];<br> }<br>}<br><br></div>The first one give me the array with the original documents, the second one the covers. Logically you should have one cover, but with users you never know :)<br><br></div>Thanks,<br></div>Denis<br><div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 8, 2016 at 5:34 PM, Denis Pitzalis <span dir="ltr"><<a href="mailto:denis.pitzalis@gmail.com" target="_blank">denis.pitzalis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div dir="ltr"><div><div><div><div><div><div><div>Hi eprinters, <br><br></div>I am uploading audio to my repository as eprints. Each eprints comes with 2 documents:<br></div>1) the audio file, content: original<br></div>2) the cover, content: cover <br><br></div>then in my summary, I have:<br><br><epc:set name='docs' expr='$item.original_documents()'><br> <!--<epc:set name='docs' expr='$item.documents()'>--><br> <epc:if test="length($docs) gt 0"><br> <epc:foreach expr="$docs" iterator="doc" limit="1"><br> <div id="summary_downloads" class="summary-widget"><br> <epc:choose><br>.....<br> <epc:when test="$doc.thumbnail_url('audio_mp4').is_set()"><br> <audio controls=""><br> <source src="{$doc.thumbnail_url('audio_mp4')}" type="audio/mp4" /><br> <source src="{$doc.thumbnail_url('audio_ogg')}" type="audio/ogg" /><br> <p class="vjs-no-js"><br> <epc:phrase ref='summary_page:vjs-no-js' /><br> </p><br> </audio><br> </epc:when><br><br></div>which is working fine, but I would like to show the cover image with the audio. How can I access it? <br><br></div>Best regards,<br></div>Denis<br></div>
</div></div><br>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><b><a href="mailto:d.pitzalis@unesco.org" style="border:none;text-decoration:none;color:#049cdb" target="_blank"><span style="color:#049cdb">Denis Pitzalis, PhD</span></a></b><br><a href="http://www.unesco.org" style="border:none;text-decoration:none;color:#b0b0b0" target="_blank"><span style="color:#b0b0b0">Web Architect/Lead Developer</span></a>
<a href="http://www.unesco.org" style="border:none;text-decoration:none;color:#b0b0b0" target="_blank">
</a><br><br><a href="http://www.unesco.org" style="border:none;text-decoration:none;color:#b0b0b0" target="_blank"><span style="color:#b0b0b0">ERI/DPI/WEB</span></a><br><a href="https://goo.gl/maps/U2TEZ2x14MM2" style="border:none;text-decoration:none;color:#b0b0b0" target="_blank"><span style="color:#b0b0b0">7, place de Fontenoy<br>
75007 <span style="color:#e0e0e0">•</span> Paris <span style="color:#e0e0e0">•</span> France</span></a> <br>
<span style="color:#b0b0b0">Tel. +33 (0) 1 45 68 18 16</span>
                                        
                                
<a href="http://www.unesco.org" style="border:none;text-decoration:none;color:#b0b0b0" target="_blank">
</a><br><br><a href="http://www.unesco.org" style="border:none;text-decoration:none;color:#b0b0b0" target="_blank"><span style="color:#b0b0b0">http://www.unesco.org</span></a></div></div></div></div></div></div></div>
</div>