Copied to clipboard

Flag this post as spam?

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


  • Vincent DeCapite 64 posts 83 karma points
    Nov 29, 2010 @ 13:47
    Vincent DeCapite
    0

    XSLT not sorting images in Umbraco

    Hi All,

    I was wondering if I could get some help with a problem that I have been having with Umbraco. We have a flash shell for our pictures that cause them to rotate on our website. These are loaded by two XSLT files, one that holds the flash animation and passes the varibles and one that is an XML version. The problem I am having is I can't get the images to sort through umbraco. They appear sorted but they never show sorted on the website. I have tried everything I could think of. Hoping I can get some help here. Below are the XSLT's and the changes I have tried: Thanks again for all your help.

    SlideshowXML.XSLT

     <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:msxml="urn:schemas-microsoft-com:xslt"
     xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:wsc.library="urn:wsc.library"
     exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib wsc.library ">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:param name="currentPage"/>
    <xsl:variable name="mediaID" select="umbraco.library:Request('id')" />
    <xsl:template match="/">
    <xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/>
    <slides>
    <xsl:if test="number($mediaID)">
     <xsl:variable name="slides" select="umbraco.library:GetMedia($mediaID, 'True')" />
     <xsl:for-each select="$slides//node [data [@alias ='active'] = 1 and data [@alias = 'umbracoFile'] !='']">
     <slide name="{@nodeName}">
         <xsl:attribute name="file">
             <xsl:choose>
                 <xsl:when test="data [@alias = 'umbracoFile']">
                  <xsl:text>/umbraco/imagegen.ashx?width=402&amp;compression=100&amp;image=</xsl:text>
                   <xsl:value-of select="umbraco.library:UrlEncode(data [@alias = 'umbracoFile'])" />
                 </xsl:when>
                    <xsl:otherwise>
                  <xsl:value-of select="data [@alias = 'umbracoFile']" />
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:attribute>       
         <xsl:attribute name="link">
             <xsl:choose>
                 <xsl:when test="data [@alias = 'externalLink'] != ''">
                     <xsl:value-of select="data [@alias = 'externalLink']" />
                    </xsl:when>
                    <xsl:when test="number(data [@alias = 'internalLink'])">
                     <xsl:value-of select="umbraco.library:NiceUrl(data [@alias = 'internalLink'])" />
                    </xsl:when>
                </xsl:choose>       
            </xsl:attribute>
        </slide>
        </xsl:for-each>
    </xsl:if>
    </slides>
    </xsl:template>
    </xsl:stylesheet>

    Here are the steps I have tried so far with no luck:

     <xsl:sort select="@sortOrder" data-type="number" order="ascending" />
    <xsl:sort select="data [@alias = 'Community Involvement']" order="ascending"/>
    <xsl:sort select="data [@alias = 'Slides]" order="ascending"/>

    Again any help would be greatly appreciated I am really stumped on this.. Thanks!

  • Sean Mooney 131 posts 158 karma points c-trib
    Nov 29, 2010 @ 14:44
    Sean Mooney
    0

    Not applying any sort they should out put in the order that they are in umbraco. This may be a browser cache issue.

    have you tried this:

    <xsl:for-each select="$slides//node [data [@alias ='active'] = 1 and data [@alias = 'umbracoFile'] !='']">
    <xsl:sort select="@sortOrder" order="ascending" /> 
    ...
    </xsl:for-each>
  • Vincent DeCapite 64 posts 83 karma points
    Nov 29, 2010 @ 15:51
    Vincent DeCapite
    0

    Thanks for the quick relply. Tried what you suggested above and still no luck... Also tried clearing and deleting all temp, cookies, cached internet files, still no luck.. It seems like the sort is not doing anything at all.

Please Sign in or register to post replies

Write your reply to:

Draft