EPrints Technical Mailing List Archive
Message: #05819
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Citations and covers
- To: Eprints Tech Mailing List <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Citations and covers
- From: Denis Pitzalis <denis.pitzalis@gmail.com>
- Date: Mon, 11 Jul 2016 18:25:38 +0200
Dear all,
this is how I've solved the issue, and I hope I'll help somebody else too. This is my eprint citation:<?xml version="1.0" ?>
<cite:citation xmlns="http://www.w3.org/1999/xhtml" xmlns:cite="" href="http://eprints.org/ep3/citation">http://eprints.org/ep3/citation" xmlns:epc="http://eprints.org/ep3/control">
<epc:set name='docs' expr='$item.original_documents()'>
<epc:if test="length($docs) gt 0">
<epc:foreach expr="$docs" iterator="doc" limit="1">
<div class="col-md-3">
<div class="thumbnail">
<epc:set name='covers' expr='$item.cover_image()'>
<epc:if test="length($covers) gt 0">
<epc:foreach expr="$covers" iterator="cover" limit="1">
<cite:linkhere><img src="" class="img-rounded img-responsive" /> </cite:linkhere>
</epc:foreach>
</epc:if>
<epc:if test="length($covers) gt 0">
<cite:linkhere><img src="" class="img-rounded img-responsive" /> </cite:linkhere>
</epc:if>
</epc:set>
<div class="caption">
<epc:choose>
<epc:when test="type = 'article'"> <i class="fa fa-paperclip" aria-hidden="true"> Document </i> </epc:when>
<epc:when test="type = 'audio'"> <i class="fa fa-music" aria-hidden="true"> Audio</i> </epc:when>
<epc:when test="type = 'book'"> <i class="fa fa-book" aria-hidden="true"> Book</i> </epc:when>
<epc:when test="type = 'image'"> <i class="fa fa-picture-o" aria-hidden="true"> Image</i> </epc:when>
<epc:when test="type = 'video'"> <i class="fa fa-video-camera" aria-hidden="true"> Video</i> </epc:when>
<epc:otherwise> <i class="fa fa-file-archive-o" aria-hidden="true"> Archive </i> </epc:otherwise>
</epc:choose>
<epc:choose>
<epc:when test="strlen(title) gt 80">
<h3><cite:linkhere><epc:print expr="substr(title,0,70)" />...</cite:linkhere></h3> </epc:when>
<epc:otherwise>
<h3><cite:linkhere><epc:print expr="title" /></cite:linkhere></h3> </epc:otherwise>
</epc:choose>
<epc:if test="is_set(date)">
<epc:print expr="substr(date.as_string(),0,4)" /></epc:if>
<epc:if test="is_set(creators_name)">
<epc:choose>
<epc:when test="length(creators_name) gt 0">
<epc:set name="creators" expr="creators_name" limit="1">
<epc:foreach expr="$creators" iterator="creator">
<epc:print expr="$creator" /> </epc:foreach>
</epc:set>
</epc:when>
</epc:choose>
</epc:if>
</div>
</div>
</div>
</epc:foreach>
</epc:if>
</epc:set>
</cite:citation>
{
package EPrints::Script::Compiled;
sub run_original_documents {
my( $self, $state, $eprint ) = @_;
if( ! $eprint->[0]->isa( "EPrints::DataObj::EPrint") ) {
$self->runtime_error( "documents() must be called on an eprint object." );
}
return [ [grep { $_->is_set( "content" ) && $_->value( "content" ) eq "original" } $eprint->[0]->get_all_documents()], "ARRAY" ];
};
sub run_cover_image {
my( $self, $state, $eprint ) = @_;
if( ! $eprint->[0]->isa( "EPrints::DataObj::EPrint") ) {
$self->runtime_error( "cover_image() must be called on an eprint object." );
}
return [ [grep { $_->is_set( "content" ) && $_->value( "content" ) eq "coverimage" } $eprint->[0]->get_all_documents()], "ARRAY" ];
}
}
On Fri, Jul 8, 2016 at 5:34 PM, Denis Pitzalis <denis.pitzalis@gmail.com> wrote:
DenisBest regards,which is working fine, but I would like to show the cover image with the audio. How can I access it?then in my summary, I have:2) the cover, content: cover1) the audio file, content: originalHi eprinters,I am uploading audio to my repository as eprints. Each eprints comes with 2 documents:
<epc:set name='docs' expr='$item.original_documents()'>
<!--<epc:set name='docs' expr='$item.documents()'>-->
<epc:if test="length($docs) gt 0">
<epc:foreach expr="$docs" iterator="doc" limit="1">
<div id="summary_downloads" class="summary-widget">
<epc:choose>
.....
<epc:when test="$doc.thumbnail_url('audio_mp4').is_set()">
<audio controls="">
<source src="" type="audio/mp4" />
<source src="" type="audio/ogg" />
<p class="vjs-no-js">
<epc:phrase ref='summary_page:vjs-no-js' />
</p>
</audio>
</epc:when>
*** 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/
--
- References:
- [EP-tech] Citations and covers
- From: Denis Pitzalis <denis.pitzalis@gmail.com>
- [EP-tech] Citations and covers
- Prev by Date: Re: [EP-tech] problem with generate_views
- Next by Date: Re: [EP-tech] problem with generate_views
- Previous by thread: [EP-tech] Citations and covers
- Next by thread: [EP-tech] Solr is failed - Vufind cannot communicate with the Solr Index.
- Index(es):