Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Evans 629 posts 1016 karma points
    Apr 26, 2013 @ 09:32
    Dan Evans
    0

    Tweaks to XSLT for non-image media

    I've tweaked the XSLT to show a link to files for non image media instead of a broken image. I've also converted the original filename to lowercase as images uploaded as .JPG were not returning thumbnails:

    <xsl:variable name="thumbnail" select="concat(substring-before(Exslt.ExsltStrings:lowercase($file), concat('.', Exslt.ExsltStrings:lowercase(umbracoExtension))), '_thumb.jpg')"/>
    
            <xsl:if test="position() &lt;= $mediaItemsToShow">
                <xsl:choose>
                <xsl:when test="umbracoExtension='gif' or umbracoExtension='jpg' or umbracoExtension='png' or umbracoExtension='jpeg'">
                <a href="/umbraco/editMedia.aspx?id={@id}" title="{@nodeName} (Click to edit)" style="float:left; width:100px; display:block; margin:0 5px 5px 0;">
                    <img style="-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.3);-mox-box-shadow:0 1px 2px rgba(0,0,0,0.3);box-shadow:0 1px 2px rgba(0,0,0,0.3);" src="{$thumbnail}" alt="{@nodeName}" width="100"/>
                </a>
                </xsl:when>
                <xsl:otherwise>
                    <a href="/umbraco/editMedia.aspx?id={@id}" title="{@nodeName} (Click to edit)" style="float:left; width:100px; display:block; margin:0 5px 5px 0;">
                        <xsl:value-of select="@nodeName" /> (File type: <xsl:value-of select="umbracoExtension" />)
                </a>
                </xsl:otherwise>
                </xsl:choose>
            </xsl:if>
  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Jun 04, 2013 @ 20:26
    Chriztian Steinmeier
    0

    Hi Dan - sorry for not having replied to this before...

    Which version of Umbraco are you using? The thumbnail problem doesn't occur on 4.11.x for me, though it's good to have a fix in for it since the package works with just about any version since 4.5 (because of the new schema)...

    I've toyed with a couple of other solutions for the "generic" files' thumbs but this works great too.

    I'll probably put out a new release with these in mind, when I get the time.

    /Chriztian

  • Dan Evans 629 posts 1016 karma points
    Jun 05, 2013 @ 08:41
    Dan Evans
    0

    We upgraded to 6.x just before i installed this package.

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Jun 18, 2013 @ 23:40
    Chriztian Steinmeier
    0

    Hi Dan,

    I had a pull-request from Lee Kelleher fixing the casing issue - and I've implemented generic thumbnails (using the placehold.it service) for non-image media.

    It's available in version 1.2 - you can go download the upgraded XSLT file directly from GitHub here (click the "Raw" button to download):

    https://github.com/greystate/LatestEditsDashboard/blob/635d8aea500466425af0c4c11bf9615eb35f8436/dist/LatestEdits.xslt

    Thanks for the heads up - please don't hesitate to report other issues if you find some.

    /Chriztian 

Please Sign in or register to post replies

Write your reply to:

Draft