Good day,

While I am still writing a Video Filter module for thumbnails, our 
organization wants to use more appropriate "placeholder" icons (e.g. for 
videos display a video icon and for audio, audio icon)
I have been able to edit the *item-view-xsl *file to achieve the above, but 
only if one multimedia file is in show. If I have both video and audio as 
items on the same submission; my code fails by only displaying the icon of 
the first file for the rest. This means that the mimetype variable I use is 
load only once. My hope is to get it to reload with each individual file.

See below code:

<xsl:template match="mets:file">
        <xsl:param name="context" select="."/>
<xsl:variable name="mimetype">
<xsl:value-of select="//mets:fileGrp[@USE='CONTENT']/mets:file/@MIMETYPE" />
</xsl:variable>
        <div class="file-wrapper clearfix">
            <div class="thumbnail-wrapper" style="width: 
{$thumbnail.maxwidth}px;">
                <a class="image-link">
                    <xsl:attribute name="href">
                        <xsl:value-of 
select="mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
                    </xsl:attribute>
                    <xsl:choose>
                        <xsl:when 
test="$context/mets:fileSec/mets:fileGrp[@USE='THUMBNAIL']/
                        mets:file[@GROUPID=current()/@GROUPID]">
                            <img alt="Thumbnail">
                                <xsl:attribute name="src">
                                    <xsl:value-of 
select="$context/mets:fileSec/mets:fileGrp[@USE='THUMBNAIL']/
                                    
mets:file[@GROUPID=current()/@GROUPID]/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
                                </xsl:attribute>
                            </img>
                        </xsl:when>
<xsl:when test="$mimetype = 'audio/x-mpeg'">
<img alt="Icon" src="{concat($theme-path, '/images/audio_icon.png')}" 
style="height: {$thumbnail.maxheight}px;"/>
</xsl:when>
<xsl:when test="$mimetype = 'video/mpeg-4'">
<img alt="Icon" src="{concat($theme-path, '/images/video_icon.png')}" 
style="height: {$thumbnail.maxheight}px;"/>
</xsl:when>
                        <xsl:otherwise>
                            <img alt="Icon" src="{concat($theme-path, 
'/images/mime.png')}" style="height: {$thumbnail.maxheight}px;"/>
                        </xsl:otherwise>
                    </xsl:choose>

How can I get the "mimetype" variable to load per file. If there is a more 
efficient way please point me to it.

Regards
Vusani
Parliament RSA

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to