Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Custom Sort via the XSL and custom template?

$
0
0

I am trying to add a sort order to a CQWP. I would like a template style that does the sorting? I have to sort by a field called SortOrder, then I want it to be by file name - here is the code:

I am thinking to do a foreach but not able to get it working? Is there another easier way?

<!--Start Custom Policy Sort-->

    <xsl:template name="PolicySortedBullets" match="Row[@Style='PolicySortedBullets']" mode="itemstyle">
        <xsl:variable name="SafeLinkUrl">
            <xsl:call-template name="OuterTemplate.GetSafeLink">
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="DisplayTitle">
            <xsl:call-template name="OuterTemplate.GetTitle">
                <xsl:with-param name="Title" select="@Title"/>
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <div class="item link-item bullet">
            <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
   <a href="{$SafeLinkUrl}" title="{@LinkToolTip}" target="_blank">
              <xsl:if test="$ItemsHaveStreams = 'True'">
                <xsl:attribute name="onclick">
                  <xsl:value-of select="@OnClickForWebRendering"/>
                </xsl:attribute>
              </xsl:if>
              <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                <xsl:attribute name="onclick">
                  <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                </xsl:attribute>
              </xsl:if>
              <xsl:value-of select="$DisplayTitle"/>
            </a>
        </div>
    </xsl:template>
<!--End Custom Policy Sort-->


Viewing all articles
Browse latest Browse all 11571


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>